- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
We are currently upgrading our scripts from IronPhyton 2 to CPhyton 3
I want to create the Non-Linear Model Definition of the supports. In the script attached, the supports are created successfully. However, as the second picture shows, the definition of K1,D1, and K2 do not appear.
Could someone help me to check why is it not working?
Thanks in advance!
Best regards,
Stefany Salguero
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
from System import Environment
user = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
clr.AddReference(user+r"\Dynamo\Dynamo Core\2.11\packages\Structural Analysis for Dynamo\bin\RSA\Interop.RobotOM.dll")
from RobotOM import *
from System import Object
#The inputs to this node will be stored as a list in the IN variables.
#Define input
nodeSupportName = IN[0]
Model_name = IN[1]
K1= IN[2]
D1 = IN[3]
K2 = IN[4]
nodeSupportData = IN[5]
application = RobotApplicationClass()
project = application.Project
structure = project.Structure
labels = structure.Labels
ProjectPrefs = project.Preferences
lab_serv=IRobotLabelServer
#Lab_serv=labels
#NodeSupport
KNLL = IRobotNonlinearLinkServer
KNLL = IRobotNonlinearLink
KnnLP= IRobotNonlinearLinkParamsBLinear
for i in range(len(nodeSupportName)):
KNLL= structure.Nodes.NonlinearLinks.Create(Model_name[i])
KNLL.ModelType= IRobotNonlinearLinkModelType.I_NLMT_FORCE_DISPLACEMENT
KNLL.SetCurveType(IRobotNonlinearLinkCurveType.I_NLCT_B_LINEAR)
KnnLP = KNLL.GetParams(IRobotNonlinearLinkSemiAxisType.I_NLSAT_ANY)
KnnLP.D1 = D1[i]
KnnLP.K1 = K1[i]
KnnLP.K2 = K2[i]
#KnnLP.D1 = 10
#KnnLP.K1 = 20
#KnnLP.K2 = 30
KNLL.SetParams(KnnLP)
node = IRobotLabel(labels.Create(IRobotLabelType.I_LT_NODE_SUPPORT, nodeSupportName[i]))
#node = robapp.Project.Structure.Labels.Create(IRobotLabelType.I_LT_NODE_SUPPORT, nodeSupportName[i]))
relData=IRobotNodeSupportData(node.Data)
relData.NonlinearModel.Set(IRobotDegreeOfFreedom.I_DOF_UX, KNLL.Name)
relData.NonlinearModel.Set(IRobotDegreeOfFreedom.I_DOF_UY, KNLL.Name)
node.Data.UZ = nodeSupportData[0]
node.Data.RX = nodeSupportData[1]
node.Data.RY = nodeSupportData[2]
node.Data.RZ = nodeSupportData[3]
labels.Store(node)
application.Visible = True
application.Interactive = True
application.Project.ViewMngr.Refresh()
OUT = node.Data
Solved! Go to Solution.
Link copied