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: 

Change of local Z axis sense with Robot API

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
LuisCRodrigues
1174 Views, 8 Replies

Change of local Z axis sense with Robot API

I want to change the sense of local Z axis of a panel using Robot API.
I've searched the API help and I didn't found any method to do so.
It has a method to define the local X axis but not the Z axis.

Does anyone knows a way to do this?

Thanks in advance.

8 REPLIES 8
Message 2 of 9

Try to use the following code which changes the orientation of the Z axis for the panel number 1:

Dim r As New RobotOM.RobotApplication
Dim o As RobotOM.RobotObjObject
o = r.Project.Structure.Objects.Get(1)
o.Main.Attribs.DirZ = 1
o.Update()

 

If you find your post answered press the Accept as Solution button please. This will help other users to find solutions much faster. Thank you.



Artur Kosakowski
Message 3 of 9

Problem solved!

Thanks for your help.

Message 4 of 9

Hi Artur,

 

Could you tell me how the z-axis and other  axes (x and y)will be oriented if I use the snippet of code provided by you? I am unable to figure it out?

 

Thanks in advance!

Message 5 of 9
rhlkochar
in reply to: rhlkochar

Hi,

 

Actually, I want my local coordinate axes for each panel to be such that the z-axis is always pointing outward. 

Message 6 of 9

also, there is a syntax error with the following line:

 

o.Update()

Message 7 of 9
Rafal.Gaweda
in reply to: rhlkochar

Hi @rhlkochar

 

 

Actually, I want my local coordinate axes for each panel to be such that the z-axis is always pointing outward. 


You have to check local Z vector and change it according to your needs

 

Dim RSel As RobotSelection
    Set RSel = RobApp.Project.Structure.Selections.CreateFull(I_OT_PANEL)
    Dim PanelCol As RobotObjObjectCollection
    Set PanelCol = RobApp.Project.Structure.Objects.GetMany(RSel)

Dim X As RobotGeoPoint3D, Y As RobotGeoPoint3D, Z As RobotGeoPoint3D
    Dim Obj As RobotObjObject
    
    Set X = RobApp.CmpntFactory.Create(I_CT_GEO_POINT_3D)
    Set Y = RobApp.CmpntFactory.Create(I_CT_GEO_POINT_3D)
    Set Z = RobApp.CmpntFactory.Create(I_CT_GEO_POINT_3D)
        
        
        Set Obj = PanelCol.Get(1)
        Obj.Main.Attribs.GetLCS X, Y, Z


Rafal Gaweda
Message 8 of 9
Rafal.Gaweda
in reply to: rhlkochar

Hi @rhlkochar

 

also, there is a syntax error with the following line:

 

o.Update()


 

This is C# code

 

In case of VBA : o.Update



Rafal Gaweda
Message 9 of 9
Rafal.Gaweda
in reply to: rhlkochar

Hi @rhlkochar

 

Hint:

o.Main.Attribs.DirZ = 0  'default (assigned by program) local Z direction 

o.Main.Attribs.DirZ = 1 ' opposite to default direction



Rafal Gaweda

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

Post to forums  

Autodesk Design & Make Report