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: 

ROBOT / API / VBA - Panel Groups

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
882 Views, 5 Replies

ROBOT / API / VBA - Panel Groups

Hi,

 

I tried to create panels grous using VBA/API and found this old subject: http://forums.autodesk.com/t5/robot-structural-analysis/create-group-of-bars-api/m-p/3590758/highlig...

 

I manage to make a code that seems to work:

 

     Sub groupes_plaques()

     '****************************************************************************************
     'Group objects creation ***********************************************************
     Dim robot As RobotApplication
     Set robot = New RobotApplication
     Dim group_name As RobotGroup
     Dim idx As Integer

     onglet = 'name of the sheet
     nb_groups = Sheets(onglet).Range("nb_groupes") 'value in the sheet

     For i = 1 To nb_groups

     group_name = Sheets(onglet).Range("nb_groupes").Offset(i, -1)
     num_plaques = Sheets(onglet).Range("nb_groupes").Offset(i, 0)
     robot.Project.Structure.Groups.Create I_OT_PANEL, group_name, num_plaques
     idx = robot.Project.Structure.Groups.Find(I_OT_PANEL, group_name)

     Set group_name = robot.Project.Structure.Groups.Get(I_OT_PANEL, idx)
     group_name.SelList = group_name.SelList + " 3"
     'Group_1.SelList = Group_1.SelList + " 3"
     group_name.Store

     Next i

    robot.Project.ViewMngr.Refresh

    End Sub

 

 

Now, I'm trying to make appear / disappear groups. 

For example, I'd like to display only the elements of the first goup.

Is there any way to do this? If yes, is it possible to have the beginning of the code please?

 

Thanks for answering,

 

VE

 

5 REPLIES 5
Message 2 of 6
Rafal.Gaweda
in reply to: Anonymous

Create new view - recommended IRobotView3 type and assign correct selection

Check this thread
http://forums.autodesk.com/t5/robot-structural-analysis/command-vba-projection-capture-of-a-view/td-...


Rafal Gaweda
Message 3 of 6
Anonymous
in reply to: Rafal.Gaweda

Hi,

 

Thanks for answering.

 

I don't find the command that allows me to display the desired group.

 

I guess it begins like this:

 

     Dim recorded_view As IRobotView3
     Set recorded_view = robot.Project.ViewMngr.GetView(1)

Could ou help me to continue the code please?

 

Thanks.

 

 

 

 

Message 4 of 6
Anonymous
in reply to: Anonymous

I think i'm going to make it like this!

 

Dim recorded_view As IRobotView3
Set recorded_view = robot.Project.ViewMngr.GetView(1)
recorded_view.Selection.Get(I_OT_PANEL).FromText ("group_name")
recorded_view.Redraw (True)
robot.Project.ViewMngr.Refresh

 

If I use this solution, i think it's useless to create groups...

 

 

Message 5 of 6
Rafal.Gaweda
in reply to: Anonymous

 

recorded_view.Selection.Get(I_OT_PANEL).FromText (Group.SelList)

 



Rafal Gaweda
Message 6 of 6
Anonymous
in reply to: Rafal.Gaweda

Thank you VM

 

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

Post to forums  

Autodesk Design & Make Report