hexagon logo

Macro to create markers at a fixed location in multiple identical objects.

I have multiple identical objects (pistons) in my Adams model. I want to create a marker at the center of back face in each piston. ( as seen below)
image
I want to know can I automate this process using some macro.
(The location on highlighting is seen as p1.SOLID40.E6 (center). Like this there are multiple other pistons p2, p3, ...... in the model and position for marker creation in each piston will be same- SOLID40.E6 (center) )
Parents
  • Hi,
     
    In the same code you may choose "location = 0.0, 0.0, 0.0" to locate the new marker at the reference of a marker of interest which is specified as:
     
       relative_to = (eval(myMod.object_value//".P_"//RTOI(thePiston)//".MARKER_1"))
     
    Here you can choose the name of any other markers instead of MARKER_1.
    In this way the new marker can be defined at the origin of this marker.
     
Reply
  • Hi,
     
    In the same code you may choose "location = 0.0, 0.0, 0.0" to locate the new marker at the reference of a marker of interest which is specified as:
     
       relative_to = (eval(myMod.object_value//".P_"//RTOI(thePiston)//".MARKER_1"))
     
    Here you can choose the name of any other markers instead of MARKER_1.
    In this way the new marker can be defined at the origin of this marker.
     
Children
No Data