(API) Macro - Changing design code

(API) Macro - Changing design code

Anonymous
Not applicable
606 Views
1 Reply
Message 1 of 2

(API) Macro - Changing design code

Anonymous
Not applicable

 

 

Hello Everyone,

 

I am trying to compile a Robot macro to change design standards (and databases etc.) in existing models. So far I managed to write a script which does change the standard (see example below)  but it only works if the standard is already loaded into to "Current codes:" list - please see picture below. If the standard is not loaded (manually) into current codes the script does not work (e.g. if I changed the "BS 5950:2000" to "ANSI/AISC 360-05" it would not work.).

 

Is it possible to change the standard with an API code to another standard which is not in the Current Codes list? Or is it possible to script the loading process to the current codes?

 

Thank you!

 

Sub ChangeCode()

Dim Robot As New RobotApplication

Robot.Project.Preferences.SetActiveCode I_CT_STEEL_STRUCTURES, "BS 5950:2000"

End Sub

Code.jpg

0 Likes
Accepted solutions (1)
607 Views
1 Reply
Reply (1)
Message 2 of 2

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Hi @Anonymous 

 

It should work:

 



Rafal Gaweda
0 Likes