
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear Autodesk community:
Good afternoon
I hope everybody is fine
I would like to explain the following problem that recently appeared when I was trying to create Ax, Iy, Iz steel section through Python-Dynamo nodes. Based on a script found in this forum, I created a special script to create Ax, Iy, Iz sections linking values as free values to the code. Despite the script creates the section within the robot interface, the value defined for Iy is 0 when the values should be 1000 (this is just a number, it was defined with number nodes from Dynamo).
Can everyone help me to fix the script, please?. I am novel using the API from Autodesk Robot, but I understand some concepts due to I read the guide for API.
I attach some pictures to show the visual programming script and the Python script created in this case.
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('DSCoreNodes')
clr.AddReferenceToFileAndPath(r"C:\Program Files\Autodesk\Autodesk Robot Structural Analysis Professional 2022\Exe\Interop.RobotOM.dll")
from RobotOM import *
dataEnteringNode = IN
SectionName = IN[0]
SectionIy = IN[1]
SectionMaterial = IN[2]
robapp = RobotApplicationClass()
rproject = robapp.Project
rstructure = rproject.Structure
rlabelserver = rstructure.Labels
rselectionfactory = rstructure.Selections
rloadcaseserver = rstructure.Cases
sectionlabel = rlabelserver.Create(IRobotLabelType.I_LT_BAR_SECTION, SectionName)
sectionlabeldata = sectionlabel.Data
datatype = IRobotBarSectionType.I_BST_STANDARD
sectiontype = IRobotBarSectionShapeType.I_BSST_UNKNOWN
rlabelserver.Store(sectionlabel)
nonst_data = IRobotBarSectionNonstdDataValue
nonst_data = sectionlabeldata.CreateNonstd(0)
nonst_data.SetValue(IRobotBarSectionDataValue.I_BSDV_AX, 0)
nonst_data.SetValue(IRobotBarSectionDataValue.I_BSDV_AY, 0)
nonst_data.SetValue(IRobotBarSectionDataValue.I_BSDV_AZ, 0)
nonst_data.SetValue(IRobotBarSectionDataValue.I_BSDV_IX, 1)
nonst_data.SetValue(IRobotBarSectionDataValue.I_BSDV_IY, SectionIy)
nonst_data.SetValue(IRobotBarSectionDataValue.I_BSDV_IZ, 2)
MaterialName = SectionMaterial
rlabelserver.Store(sectionlabel)
OUT = SectionName, SectionIy, SectionMaterial
Solved! Go to Solution.