Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
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) Translate whole structure

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
JacquesGaudin
981 Views, 10 Replies

(API) Translate whole structure

I am trying to translate the whole structure using the API. 

 

My initial idea was to select all nodes with `Structure.Nodes.CreateFull()` and then use `Structure.SelTranslate` but this doesn't translate any of the nodes.

 

So far the workaround I found is to iterate over the selection and move all nodes one by one with `Structure.TranslateNode`. This takes a long time however.

 

Is there a way to translate all nodes at once?

Tags (3)
10 REPLIES 10
Message 2 of 11

Hi @JacquesGaudin 

 

It works on selection "in Robot" - by Get.

Example:

Set sel = RobApp.Project.Structure.Selections.Get(I_OT_NODE)
sel.FromText "All"

RobApp.Project.Structure.Edit.SelTranslate 15, 0, 0, I_TO_COPY, 1


Rafal Gaweda
Message 3 of 11

Thanks @Rafal.Gaweda  it works indeed. What is the difference between `CreateFull` and `Get` + `FromText('all')`? 

 

I find the API reference a bit obscure when it comes to selections.

Message 4 of 11

Hi @JacquesGaudin 

 

Create... methods create selections in API to work with API. These selections are not visible in Robot.

Get - get selections from Robot \ model. You can Get even empty selection and the fill it as You like. 

 

NOTE: playing with selections Got from Robot may be more time consuming as Robot will refresh them (display of them) on display \ model. 

 

So

 

Dim sel As RobotSelection
Set sel = RobApp.Project.Structure.Selections.Get(I_OT_NODE)
sel.FromText "All"

 

gives the same effect as

 

Dim sel As RobotSelection
Dim sel1 As RobotSelection
Set sel = RobApp.Project.Structure.Selections.CreateFull(I_OT_NODE)
Set sel1 = RobApp.Project.Structure.Selections.Get(I_OT_NODE)
sel1.FromText sel.ToText

 

or

Dim sel As RobotSelection
Dim sel1 As RobotSelection
Set sel = RobApp.Project.Structure.Selections.CreateFull(I_OT_NODE)
Set sel1 = RobApp.Project.Structure.Selections.Get(I_OT_NODE)
sel1.Clear
sel1.Add sel

 



Rafal Gaweda
Message 5 of 11

Thanks for the explanation @Rafal.Gaweda, that makes perfect sense. I wish there was a few examples like this in the documentation.

Message 6 of 11
Anonymous
in reply to: JacquesGaudin

Dear all,

 

How to combine nodes and bars in the same selection?

Thanks a lot

 

Message 7 of 11
JacquesGaudin
in reply to: Anonymous

@Anonymous 

 

What are you trying to achieve? You may have better luck posting a new question.

 

If your problem is related to translating elements in the structure, moving the nodes will move the bars too since the bars are defined with a reference to the start/end node numbers.

Message 8 of 11
Anonymous
in reply to: JacquesGaudin

Thanks @JacquesGaudin ,

 

My issue is in SelRotate command (similar than SelTranslate).

The thing is when I rotate my structure by selection of nodes, all bars are translated properly but the Gamma angle is not changed (is the same value than with no rotation), therefore I need rotate all my nodes and bars at the same time, so that this gamma is updated.

I've tried it with I_OT_OBJECT and the process is OK, but there are some isolated node that is not rotated.

 

Thanks for your comments.

Message 9 of 11
JacquesGaudin
in reply to: Anonymous

If I remember correctly, ``SelRotate`` operates on the selection in Robot's window (the one you can actually see on the screen) which is a IRobotMultiSelection. The following should work to select bars and nodes and apply a rotation to them.

 

Set selNode = RobApp.Project.Structure.Selections.Get(I_OT_NODE)
selNode.FromText "All"

Set selBar = RobApp.Project.Structure.Selections.Get(I_OT_BAR)
selBar.FromText "All"

SelRotate p0x, p0y, p0z, p1x, p1y, p1z, angle, options, repetitions

 

Message 10 of 11
Anonymous
in reply to: JacquesGaudin

Thanks a lot @JacquesGaudin it works perfectly.

I was thinking that when the bars are selected the selection of nodes was lost.

 

Thank you.

Message 11 of 11
JacquesGaudin
in reply to: Anonymous

I find this a bit confusing too but glad it works!

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

Post to forums  

Autodesk Design & Make Report