WM Scripting
Moderator: scott
-
- Dabbler
- Posts: 5
- Joined: Mon Sep 18, 2006 6:12 pm
WM Scripting
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?
re: WM Scripting
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.---
-- May the force lift you up. In case it doesn't, try something else.---
re: WM Scripting
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.
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.