Creating Ax, Iy, Iz section

Creating Ax, Iy, Iz section

Anonymous
Not applicable
884 Views
5 Replies
Message 1 of 6

Creating Ax, Iy, Iz section

Anonymous
Not applicable

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.

Construccincivil_1-1654799911279.pngConstruccincivil_2-1654799926446.png

 

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

0 Likes
Accepted solutions (1)
885 Views
5 Replies
Replies (5)
Message 2 of 6

Stephane.kapetanovic
Mentor
Mentor

hi @Anonymous 

First step, try add this line

[...]
MaterialName = SectionMaterial

sectionlabeldata.CalcNonstdGeometry()

rlabelserver.Store(sectionlabel)
[...]

Best regards

 

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 3 of 6

Anonymous
Not applicable

Hi @Stephane.kapetanovic:

Thanks for your recommendation, I appreciate it. I will test your solution.

Best regards

0 Likes
Message 4 of 6

Anonymous
Not applicable

Hi @Stephane.kapetanovic:

Good afternoon

I hope you are fine

I have added the code line suggested by you, but the problem continues. The section is created within the robot interface but the structural parameters such as Ax, Ix, Iy, Iz still appear void (Zero). Despite I defined with other values in dynamo.  Can you recommend me another alternative, please?. I am sorry for the trouble.

Best regards

 

PD: I attach images where I expose the problem:

Construccincivil_0-1654973538217.pngConstruccincivil_1-1654973570054.png

 

 

 

0 Likes
Message 5 of 6

Stephane.kapetanovic
Mentor
Mentor
Accepted solution

hi @Anonymous 

try this.

[...]
SectionName = IN[0]
SectionIy = IN[1]
SectionMaterial = IN[2]

robapp = RobotApplicationClass()
RLabelServer = RobotLabelServer
RLabelServer = robapp.Project.Structure.Labels

RLabel = IRobotLabel
RLabel = RLabelServer.Create(IRobotLabelType.I_LT_BAR_SECTION, SectionName)

RLabelData = IRobotBarSectionData
RLabelData = RLabel.Data
RLabelData.MaterialName = SectionMaterial
RLabelData.Type = IRobotBarSectionType.I_BST_STANDARD
RLabelData.ShapeType = IRobotBarSectionShapeType.I_BSST_UNKNOWN

RLabelData.SetValue(IRobotBarSectionDataValue.I_BSDV_AX, 0)
RLabelData.SetValue(IRobotBarSectionDataValue.I_BSDV_AY, 0)
RLabelData.SetValue(IRobotBarSectionDataValue.I_BSDV_AZ, 0)
RLabelData.SetValue(IRobotBarSectionDataValue.I_BSDV_IX, 1)
RLabelData.SetValue(IRobotBarSectionDataValue.I_BSDV_IY, SectionIy)
RLabelData.SetValue(IRobotBarSectionDataValue.I_BSDV_IZ, 2)

RLabelServer.Store(RLabel)

OUT = SectionName, SectionIy, SectionMaterial

Best regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 6 of 6

Anonymous
Not applicable

Hi @Stephane.kapetanovic:

Good morning

The solution proposed by you has worked so well. I would like to thank you for your recommendations and comments. You have saved my thesis. I will put your name on the acknowledgment section of my potential paper.

Best regards

Construccincivil_0-1655083989534.pngConstruccincivil_1-1655084068707.png

 

0 Likes