(API) Select all panels for mesh generation

(API) Select all panels for mesh generation

Anonymous
Not applicable
966 Views
7 Replies
Message 1 of 8

(API) Select all panels for mesh generation

Anonymous
Not applicable

Hi!

 

I would like to select all panel objects, generate mesh and freez it. 

 

IRobotObjObject Panelx;
Panelx = (IRobotObjObject)robApp.Project.Structure.Objects.GetAll(); - unfortunately it can not be converted to IRobotObjObject.

Panelx = (IRobotObjObject)robApp.Project.Structure.Objects.Get(1); - unfortunately I must define variable int that selects only plates and mesh will be generated plate by plate.

 

Panelx.Mesh.Generate();

Panelx.Mesh.Freeze = true;

 

Is there a way to select all panels at once or I should use .Get(i) and generate mesh plate by plate?

 

Best Regards,

Daniel

0 Likes
Accepted solutions (1)
967 Views
7 Replies
Replies (7)
Message 2 of 8

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution

Objects are all geometrical model elements except nodes so you have to create correct selection \ collection limited to panels only.

 

 

    Dim RSelection As RobotSelection
    Set RSelection = RobApp.Project.Structure.Selections.Create(I_OT_PANEL)
    RSelection.FromText "all"
    Dim PanelCol As RobotObjObjectCollection
    Set PanelCol = RobApp.Project.Structure.Objects.GetMany(RSelection)

then play with panels from this collection



Rafal Gaweda
Message 3 of 8

Anonymous
Not applicable

Thank you!

0 Likes
Message 4 of 8

Anonymous
Not applicable

Is there a way to modify the attributes of numerous panels all at once? For example I want to select all my panels, and then apply .Main.Attribs.Meshed = True and .SetLabel and .Initialise, but I am not able to do this while using the .GetMany function, just .Get for an individual panel. The reason I need this is I am creating thousands of panels and applying the attributes one at a time in a loop takes a long time and I am trying to reduce this. Thank you in advance!

0 Likes
Message 5 of 8

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous 

 

Is there a way to modify the attributes of numerous panels all at once? For example I want to select all my panels, and then apply .Main.Attribs.Meshed = True

 

No

 

and .SetLabel

 

RobApp.Project.Structure.Objects.SetLabel()

 

and .Initialise,

 

No

 



Rafal Gaweda
0 Likes
Message 6 of 8

Anonymous
Not applicable

Hi Rafal,

 

Thank you very much for your reply.

 

I am using VBA and the current code I have for assigning the panel thickness is;

 

Dim Panel as RobotObjObjectServer

Set Panel = RobApp.Project.Structure.Objects

 

Dim ActivePanel as RobotObjObject

Set ActivePanel = Panel.Get (i) 'looping through from i = 0 to the number of panels

ActivePanel.SetLabel XXX,XXX 'with the required thickness label

 

 

What I would like instead is to have something like:

Set ActivePanel = Panel.GetAll

ActivePanel.SetLabel XXX,XXX

 

so all panels are set the same label in one line of code, but I don't quite understand how to make this work. Would you be able to point me in the right direction?

 

Thank you

 

0 Likes
Message 7 of 8

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @Anonymous 

 

Example:

    Dim RSelection As RobotSelection
    Set RSelection = RobApp.Project.Structure.Selections.CreateFull(I_OT_PANEL)
    RobApp.Project.Structure.Objects.SetLabel RSelection, I_LT_PANEL_THICKNESS, "MY_THICKNESS"


Rafal Gaweda
Message 8 of 8

Anonymous
Not applicable

Hi Rafal,

 

That has worked a charm. As always, thank you so much for your support 🙂

0 Likes