This content has been marked as final.
Show 2 replies
-
Re: how do I change the value of the force in macro
Amen Allah Jlili Jan 3, 2016 11:33 AM (in response to Ryan Lee)Can you show us the problematic part of your code?
-
Re: how do I change the value of the force in macro
Attilio Colangelo Jan 5, 2016 8:39 AM (in response to Ryan Lee)I agree, it is easier to edit an existing load than to create one. It goes something like this:
Set LBCMgr = Study.LoadsAndRestraintsManager
Set myForce= LBCMgr.GetLoadsAndRestraints(1, errCode) 'This is the key line to get an existing force
myForce.ForceBeginEdit
myForce.NormalForceOrTorqueValue = 50 'Put your actual force value here
myForce.ForceEndEdit
Breaking down GetLoadsAndRestraints(NIndex, ErrorCode), Nindex refers to a zero-based index of all the loads and restraints so you need to determine which order your force load appears in the tree. What I find handy to make sure you have the proper load is to print them as follows:
Debug.Print myForce.Name, myForce.Type