@J0EL wrote:
Hi all,
I have some coordinates that I am able to export from another tool to give general component locations, and I'd like to be able to take this file and somehow automate the placement of parts in a blank assembly. Each component could be fixed in place for this, or assembled to a CSYS, if it's eaiser to import a bunch of CSYSs.
I have no problem creating an external script to translate the output of the tool in to any format needed, but I just don't know how best to approach the placment of the parts.
I looked at trail files, but I don't see a way to use actual numbers for XYZ, since the placement is done with the mouse. Even with AutoIT, I don't see a way to assemble a part and then enter XYZ coordinates for placement.
Thanks
Hi,
if I were you I would use trail files.
Below you can find trail file which creates 1 assembly CSYS.
!trail file version No. 1861
!Creo TM 4.0 (c) 2020 by PTC Inc. All Rights Reserved.
~ Command `ProCmdDatumCsys`
!ODUI session starting: Okit widgets are on, Undo/Redo on, Dashboard style off, Tab style on. Feature title : Coordinate System
!ODUI session started.
!%CPSelect up to 3 references, such as plane, edge, coordinate system, or point to place coordinate system.
~ Command `ProCmdMdlTreeSearch`
!%CINo Names Available
~ Open `selspecdlg0` `SelOptionRadio`
~ Close `selspecdlg0` `SelOptionRadio`
~ Select `selspecdlg0` `SelOptionRadio` 1 `Coord Sys`
~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` `ASM_DEF_CSYS`
~ Activate `selspecdlg0` `EvaluateBtn`
~ Activate `selspecdlg0` `ApplyBtn`
~ Activate `selspecdlg0` `CancelButton`
!%CPSelect up to 3 references, such as plane, edge, coordinate system, or point to place coordinate system.
~ FocusIn `Odui_Dlg_00` `t1.OffsetInputX`
~ Input `Odui_Dlg_00` `t1.OffsetInputX` `110.00`
~ FocusOut `Odui_Dlg_00` `t1.OffsetInputX`
~ FocusIn `Odui_Dlg_00` `t1.OffsetInputY`
!%CPSelect up to 3 references, such as plane, edge, coordinate system, or point to place coordinate system.
~ Input `Odui_Dlg_00` `t1.OffsetInputY` `210.00`
~ FocusOut `Odui_Dlg_00` `t1.OffsetInputY`
~ FocusIn `Odui_Dlg_00` `t1.OffsetInputZ`
!%CPSelect up to 3 references, such as plane, edge, coordinate system, or point to place coordinate system.
~ Input `Odui_Dlg_00` `t1.OffsetInputZ` `310.00`
~ FocusOut `Odui_Dlg_00` `t1.OffsetInputZ`
!%CPSelect up to 3 references, such as plane, edge, coordinate system, or point to place coordinate system.
~ Trigger `Odui_Dlg_00` `t1.OriginPlacement` 2 `0` `type`
~ Trigger `Odui_Dlg_00` `t1.OriginPlacement` 2 `` ``
~ Select `Odui_Dlg_00` `pg_vis_tab` 1 `tab_3`
!%CPSelect up to 3 references, such as plane, edge, coordinate system, or point to place coordinate system.
~ Input `Odui_Dlg_00` `t3.datum_csys_name` `mycs02`
~ FocusOut `Odui_Dlg_00` `t3.datum_csys_name`
!%CPSelect up to 3 references, such as plane, edge, coordinate system, or point to place coordinate system.
~ Activate `Odui_Dlg_00` `stdbtn_1`
!ODUI session finished.
!F5(MYCS01)
!Undo: added rec_id 53 type 5304
ASM_DEF_CSYS ... name of parent CSYS
110.0 ... X-coordinate
210.0 ... Y-coordinate
310.0 ... Z-coordinate
mycs02 ... CSYS name
Below you can find trail file which assembles 1 part into assembly.
!trail file version No. 1861
!Creo TM 4.0 (c) 2020 by PTC Inc. All Rights Reserved.
~ Command `ProCmdCompAssem`
< 2 0.118519 178 0 0 100 1920 0 0 1200 13
~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` \
`file_open`
~ Select `file_open` `Ph_list.Filelist` 1 `prt0001.prt`
~ Trail `UI Desktop` `UI Desktop` `PREVIEW_POPUP_TIMER` \
`file_open:Ph_list.Filelist:<NULL>`
~ Command `ProFileSelPushOpen_Standard@context_dlg_open_cmd`
!ODUI session starting: Okit widgets are on, Undo/Redo on, Dashboard style on, Tab style off. Feature title : Component Placement
!ODUI session started.
!%CPSelect any reference for auto type constraining.
~ Activate `main_dlg_cur` `chkbn.ScrLayout.0` 1
!%CPSelect any reference for auto type constraining.
~ Trigger `ScrLayout.0.0` `PH.L.S.l0.assem_ref_represent.l0.s0` `0`
~ Trigger `ScrLayout.0.0` `PH.L.S.l0.assem_ref_represent.l0.s0` ``
~ Trigger `ScrLayout.0.0` `PH.L.S.l0.comp_ref_represent.l0.s0` `0`
~ Focus `ScrLayout.0.0` `PH.L.S.l0.comp_ref_represent.l0.s0`
!%CPSelect any reference for auto type constraining.
~ Select `ScrLayout.0.0` `PH.L.S.l0.comp_ref_represent.l0.s0` 0
!%CPSelect any reference for auto type constraining.
~ Command `ProCmdMdlTreeSearch`
~ Trigger `ScrLayout.0.0` `PH.L.S.l0.comp_ref_represent.l0.s0` ``
~ Trigger `ScrLayout.0.0` `PH.L.S.l0.assem_ref_represent.l0.s0` `0`
~ Trigger `ScrLayout.0.0` `PH.L.S.l0.assem_ref_represent.l0.s0` ``
~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` `PRT_CSYS_DEF`
~ Activate `selspecdlg0` `EvaluateBtn`
~ Activate `selspecdlg0` `ApplyBtn`
~ Activate `selspecdlg0` `CancelButton`
!%CPSelect any reference for auto type constraining.
~ Trigger `ScrLayout.0.0` `PH.L.S.l0.assem_ref_represent.l0.s0` `0`
~ Focus `ScrLayout.0.0` `PH.L.S.l0.assem_ref_represent.l0.s0`
!%CPSelect any reference for auto type constraining.
~ Select `ScrLayout.0.0` `PH.L.S.l0.assem_ref_represent.l0.s0` 0
!%CPSelect any reference for auto type constraining.
~ Focus `ScrLayout.0.0` `PH.L.S.l0.assem_ref_represent.l0.s0`
~ Select `ScrLayout.0.0` `PH.L.S.l0.assem_ref_represent.l0.s0` 0
~ RButtonArm `ScrLayout.0.0` `PH.L.S.l0.assem_ref_represent.l0.s0` `0`
!%CPSelect any reference for auto type constraining.
~ Command `ProCmdMdlTreeSearch`
~ Trigger `ScrLayout.0.0` `PH.L.S.l0.assem_ref_represent.l0.s0` ``
~ Trigger `ScrLayout.0.0` `PH.L.S.l0.comp_ref_represent.l0.s0` `0`
~ Trigger `ScrLayout.0.0` `PH.L.S.l0.comp_ref_represent.l0.s0` ``
~ Open `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList`
~ Close `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList`
~ Select `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` 1 `MYCS03`
~ Activate `selspecdlg0` `EvaluateBtn`
~ Activate `selspecdlg0` `ApplyBtn`
~ Activate `selspecdlg0` `CancelButton`
!%CPSelect any reference for auto type constraining.
~ Activate `main_dlg_cur` `dashInst0.stdbtn_1`
!ODUI session finished.
!Undo: added rec_id 104 type 5304
prt0001.prt ... part name
PRT_CSYS_DEF ... part CSYS name
MYCS03 ... assembly CSYS name
To avoid CSYS clicking during trail recording I pressed CTRL+F and used Search Tool to select requested CSYS by its name.
From my point of view it is very easy to repeat trail file code and put valid information into specific lines. Therefore it is not at all difficult to create any number of CSYS features and assemble any number of models.
Note: Mastering the Nitro-Cell requires some time -AND- Free license of Nitro-Cell enables you to assemble 10 components only.