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.
Solved! Go to Solution.
Solved by Artur.Kosakowski. Go to Solution.
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.
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!
Hi,
Actually, I want my local coordinate axes for each panel to be such that the z-axis is always pointing outward.
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
Hi @rhlkochar
also, there is a syntax error with the following line:
o.Update()
This is C# code
In case of VBA : o.Update
Hi @rhlkochar
Hint:
o.Main.Attribs.DirZ = 0 'default (assigned by program) local Z direction
o.Main.Attribs.DirZ = 1 ' opposite to default direction