Hi all
A colleague created a macro to automatically place guides on a conveyor layout. This macro works well on his workstation, while on mine which has the same config (HP Z4), the parts are added to the asm but no constraints are created and all the added parts place their center of visualization on the origin of the asm.
Here is an excerpt from the macro for the constraints of the new parts:
'----------------------------------
'Inserting and constraining guides
'----------------------------------
If TRM_aval Or CInt(length) > 1044 Then
'Insert and constrain right entry guide
If tole_à_droite = False Then
Set comp = Assembly.AddComponent5(lien_guide, 0, "", False, "", 0, 0, 0) 'Insert guide in assembly
If Not Comp Is Nothing Then
guide = comp. Name2
Call Assembly.Extension.SelectByID2("Entrée@" & Conveyor & "@" & AssemblyTitle, "COORDSYS", 0, 0, 0, False, 0, Nothing, 0) Select Marker 1
Call Assembly.Extension.SelectByID2("Right Input" & larg & "@" & guide & "@" & AssemblyTitle, "COORDSYS", 0, 0, 0, True, 1, Nothing, 0) 'Select marker 2
Call Assembly.AddMate5(20, -1, False, 0, 0, 0, 0, 0, 0, 0, False, False, 0, longstatus) 'Constrain mark 1 on mark 2
Assembly.ClearSelection2 True
End If
End If
Thank you for your answers