WM Scripting

A Bessler, gravity, free-energy free-for-all. Registered users can upload files, conduct polls, and more...

Moderator: scott

Post Reply
gravity_surfer
Dabbler
Dabbler
Posts: 5
Joined: Mon Sep 18, 2006 6:12 pm

WM Scripting

Post by gravity_surfer »

I've been writing WM Scripts to overcome the lack of save/load in the trial version, but I'm running into some annoying issues. One is when I try to create a constraint (in this case a pin) WM tries to recompute the assembly after my script sets each individual dimension. This results in annoying warning messages, and it moves the parts all around in attempt to make them fit with the partially input dimensions. In addition it seems the coordinates are set relative to the attached body, which is very frustrating. Do any of you script wizards have suggestions for overcoming this? Can you flag working model to not recompute until all the dimensions are updated?
User avatar
ME
Addict
Addict
Posts: 3512
Joined: Wed Jun 08, 2005 6:37 pm
Location: Netherlands

re: WM Scripting

Post by ME »

Code: Select all

wrt "gwrkcons.AlwaysActive = false"
wrt "gwrkcons.ActiveWhen.Value = false"
...
wrt "gwrkcons.AlwaysActive = " + str$(cons.AlwaysActive)
if(not cons.AlwaysActive) then
   wrt "gwrkcons.ActiveWhen.value = " + str$(cons.ActiveWhen.value)
end if
Marchello E.
-- May the force lift you up. In case it doesn't, try something else.---
gravity_surfer
Dabbler
Dabbler
Posts: 5
Joined: Mon Sep 18, 2006 6:12 pm

re: WM Scripting

Post by gravity_surfer »

Thanks!
User avatar
jim_mich
Addict
Addict
Posts: 7467
Joined: Sun Dec 07, 2003 12:02 am
Location: Michigan
Contact:

re: WM Scripting

Post by jim_mich »

This was my most frustrating issue with learning to write WM scripts.

After making a new contraint but before you position the points you need to set the contraint AlwaysActive = False and set the ActiveWhen.Value = "0"

This will keep WM from trying to move other component when you start setting the contraint's end points. After the points are set then change AlwaysActive = True or you can put a formula into the ActiveWhen.Value.

Image
Post Reply