Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API - label manager

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
charlieCZech
884 Views, 6 Replies

API - label manager

Hello,

 

I have two questions.

 

1) How can I delete labels in the label manager by API? I would like to delete all defined supports, member types or sections which are not used in the current model.

 

2) How can I set new design code by API? Source code below sets new code only if this code is loaded from the database to the "current code list".

(Robot: Tools - Job Preferences - Design codes - Steel/Aluminum structures - More... -> Configuration of code list - and add to the current codes)

 

RobApp = New RobotApplication
RobApp.Project.Preferences.SetActiveCode(IRobotCodeType.I_CT_STEEL_STRUCTURES, "XYZ Code")
RobApp.Project.Preferences.Save()

 

Thanks in advance

6 REPLIES 6
Message 2 of 7
Rafal.Gaweda
in reply to: charlieCZech


 

1) How can I delete labels in the label manager by API?

 

Use:

 

 RobApp.Project.Structure.Labels.IsUsed

 RobApp.Project.Structure.Labels.Delete

 

2) How can I set new design code by API? 

 

See this thread:

http://forums.autodesk.com/t5/Robot-Structural-Analysis/API-buckling-length-problems/td-p/4851379/hi...



Rafal Gaweda
Message 3 of 7
charlieCZech
in reply to: Rafal.Gaweda

I'm using this code:

 

        Dim LabServ As IRobotLabelServer
        LabServ = RobApp.Project.Structure.Labels
        Dim LabCol As IRobotCollection
        LabCol = LabServ.GetAll
        Dim Label As IRobotLabel

        For j As Integer = 1 To LabCol.Count
            Label = LabCol.Get(j)
            If Label.Type = IRobotLabelType.I_LT_MEMBER_TYPE Then
                LabServ.Delete(IRobotLabelType.I_LT_MEMBER_TYPE, Label.Name)
            End If
        Next

but it deletes only member types which are used in the current model. 

 

I want to do the same as when I click on the button below

 

Delete_all.png

 

Message 4 of 7
Rafal.Gaweda
in reply to: charlieCZech

Not exists in API.
Use methods shown by me to do it by your own.


Rafal Gaweda
Message 5 of 7
charlieCZech
in reply to: Rafal.Gaweda

 

For example I have 8 defined member types in the label manager/steel member types, but only 4 member types are used in the current model. If I understand it there is no way how to delete member types which are not used in the current model by API?

Message 6 of 7
Rafal.Gaweda
in reply to: charlieCZech

        Dim LabServ As IRobotLabelServer
        Set LabServ = RobApp.Project.Structure.Labels

        Dim RNA As RobotNamesArray
        Set RNA = LabServ.GetAvailableNames(I_LT_MEMBER_TYPE)
        
        For I = 1 To RNA.Count
            If Not LabServ.IsUsed(I_LT_MEMBER_TYPE, RNA.Get(I)) Then
                LabServ.Delete I_LT_MEMBER_TYPE, RNA.Get(I)
            End If
        Next I

 



Rafal Gaweda
Message 7 of 7
charlieCZech
in reply to: Rafal.Gaweda

Yes, "RobotNamesArray" is what I need 🙂 Thank you

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report