(API) C# Hepl: Problems create cross section rectangular in C#

(API) C# Hepl: Problems create cross section rectangular in C#

chjpcoi
Advocate Advocate
812 Views
4 Replies
Message 1 of 5

(API) C# Hepl: Problems create cross section rectangular in C#

chjpcoi
Advocate
Advocate

Hello everyone

I am get start with Robot API

I want create cross section automatic, but I have problem that my code do not work

I tried to write in tow different ways but it still fails (red underline)

Option 1Option 1

Option 2Option 2

can you help me? thanks for your helps.

0 Likes
Accepted solutions (1)
813 Views
4 Replies
Replies (4)
Message 2 of 5

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Hi @chjpcoi 

 

Example:

    Dim RLabel As RobotLabel
        
    Dim RLabelData As RobotBarSectionData
    Dim RLabelNSData As RobotBarSectionNonstdData

    Set RLabel = RobApp.Project.Structure.Labels.Create(I_LT_BAR_SECTION, "my_section")
    Set RLabelData = RLabel.Data
    
    RLabelData.Type = I_BST_NS_RECT
    RLabelData.ShapeType = I_BSST_RECT_FILLED
    Set RLabelNSData = RLabelData.CreateNonstd(0)
    

    RLabelNSData.SetValue I_BSNDV_RECT_H, 0.02
    RLabelNSData.SetValue I_BSNDV_RECT_B, 1
    
    RLabelData.CalcNonstdGeometry
    
    RobApp.Project.Structure.Labels.Store RLabel
    


Rafal Gaweda
Message 3 of 5

chjpcoi
Advocate
Advocate

Hi @Rafal.Gaweda 

Thank for your helps. it's so good

- I would like to know more, but how to know how to use the parameter for each different cross section type, I do not understand the description for parameter (pic 1 below)

Pic 1Pic 1

- I want to create cross section with different type sections, how do I do? (pic 2 below)

Pic 2Pic 2

0 Likes
Message 4 of 5

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @chjpcoi 

 

They should correspond to dimensions names on Your second screen shot \ robot window.

 



Rafal Gaweda
0 Likes
Message 5 of 5

chjpcoi
Advocate
Advocate

Hi @Rafal.Gaweda 

Thanks for your answer

Can you provide me a document explaining the relationship between screen shot 1 and 2 ?

 

0 Likes