(API) External parameters

(API) External parameters

Romanich
Mentor Mentor
1,382 Views
6 Replies
Message 1 of 7

(API) External parameters

Romanich
Mentor
Mentor

Hi,

I'm trying to play with external parameters. According to the Robot API manual, it is possible to define arbitrary external parameters and assign them to individual structure elements. Unfortunately, my attempts were not successful. It seems that the UniqueId  from RobotParamDef is not working properly. Please check my code below:

Sub TestExtParam()

Dim RobApp As RobotApplication
Set RobApp = New RobotApplication

If Not RobApp.Visible Then
    Set RobApp = Nothing
    MsgBox "Open Robot and load Model", vbOKOnly, "ERROR"
    Exit Sub
End If
    
    Dim RSelection As RobotSelection
    Set RSelection = RobApp.Project.Structure.Selections.Get(I_OT_NODE)
    
    Dim AllNodes As RobotNodeCollection
    Set AllNodes = RobApp.Project.Structure.Nodes.GetMany(RSelection)
    
    Dim RNode As RobotNode
    Set RNode = AllNodes.Get(1)
    
    Dim ID As Long
    ID = RNode.UniqueId
Dim CmpFact As RobotComponentFactory
    Set CmpFact = RobApp.CmpntFactory
Dim RPD As RobotParamDef
    Set RPD = CmpFact.Create(I_CT_PARAM_DEF) RPD.ValueType = I_PVT_TEXT RPD.GuiVisible = True RPD.Name = "Node Name" RPD.GuiSetName 1, "Node Name" RPD.DefaultValue = "Pier 1" Dim Scheme As RobotParamSchema RobApp.Project.Structure.ExtParams.Schemas.Clear RobApp.Project.Structure.ExtParams.Schemas.Create "My Test Scheme" Set Scheme = RobApp.Project.Structure.ExtParams.Schemas.GetByName("My Test Scheme") Scheme.RemoveAllParams ID Scheme.SetParam ID, RPD.UniqueId, RPD.DefaultValue RPD.ValueType = I_PVT_INTEGER RPD.GuiVisible = True RPD.Name = "Radius" RPD.GuiSetName 1, "Radius" RPD.DefaultValue = 69 Scheme.SetParam ID, RPD.UniqueId, RPD.DefaultValue End Sub

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.

Roman Zhelezniak

Robot Evangelist & Passionate Civil Structural Engineer

LinkedIn | Robot & Хобот | App Store for Robot
EESignature


0 Likes
1,383 Views
6 Replies
Replies (6)
Message 2 of 7

marcinrakus
Autodesk
Autodesk

Hi,

Frankly, I didn't play with ExternalParams, but I would start with changing (for the first call)

Scheme.SetParam ID, RPD.UniqueId, RPD.DefaultValue

with

Scheme.Def.AddParam RPD

That should create guid for further usage.

Regards,

Marcin

0 Likes
Message 3 of 7

Romanich
Mentor
Mentor

Hi @marcinrakus,

 

Great, I've got UniqueId for the created external parameter. My next question is how selected part of code should work:

RPD.GuiVisible = True
RPD.GuiSetName 1, "Node Name"

I assume that external parameters should be visible in GUI.  

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.

Roman Zhelezniak

Robot Evangelist & Passionate Civil Structural Engineer

LinkedIn | Robot & Хобот | App Store for Robot
EESignature


0 Likes
Message 4 of 7

marcinrakus
Autodesk
Autodesk

Hi,

I guess the display of arbitrary external data is not supported in the current version.

Regards,

Marcin

0 Likes
Message 5 of 7

TimoKet
Contributor
Contributor
Hello, Bumping an old topic. Was there eventually any success on displaying external parameters in the Robot user interface? I've managed to create the parameters but can't find them anywhere from the GUI. Documentation indicates they should show up in "parameter browser".
0 Likes
Message 6 of 7

Romanich
Mentor
Mentor

Hi @TimoKet , 

This extremely useful feature still not implemented properly.

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.

Roman Zhelezniak

Robot Evangelist & Passionate Civil Structural Engineer

LinkedIn | Robot & Хобот | App Store for Robot
EESignature


0 Likes
Message 7 of 7

TimoKet
Contributor
Contributor

Hi @Romanich ,

 

Thank you for your fast reply. I created a idea request (couldn't find where to report bugs, as it is clearly stated in the documentation that this should be implemented) for this topic, although most likely this is a thing only for minority of users.

 

https://forums.autodesk.com/t5/robot-structural-analysis-ideas/implement-showing-external-parameters...

 

Let's see if we can gather some votes for this aswell. I find this to have quite a lot potential for integrated workflows and task automation.

 

Since Revit-Robot workflow is on the roadmap, could perhaps @Rafal.Gaweda enlighten us if this is something that could be implemented correctly in the future? 🙂