cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Edit datum points with PRO Program

liz68
6-Contributor

Edit datum points with PRO Program

I want to create a curve from datum points. To do this, I have imported the datum points offset as a table and created the curve that way. Now I want to automate this process so that I can re-import the points every time I need them and update the curve automatically. Is it possible to import the points table using PRO/Program?

 

 

 

 

 

ACCEPTED SOLUTION

Accepted Solutions
MartinHanak
24-Ruby III
(To:liz68)


@liz68 wrote:

Hello Martin,

thanks for your answer.

This looks similar to mapkeys. Unfortunately I am not really familiar with using trails.

How can I create one for my case?


Hi,

if you have "zero" experience with trail file then it would be better not use it. FYI ... when you start Creo session and do some work in it then almost every action is recorded into trail file. Its name is trail.txt.n by default. When you finish Creo session, you can rename the file and edit its contents. Later you can replay resulting file in next Creo session. This enables you repeat recorded actions.

I think if you search community web, you will find more information concerning trail files.

 

Maybe it will be enough if you write a procedure How to update the set of points into Word document and use this document, when you need it:

  1. open new datum point table in Notepad outside of Creo
  2. in Creo edit definition of point feature
  3. click Update button
  4. delete old point table
  5. copy new datum point table from Notepad
  6. save
  7. finish edit definition action
  8. regenerate model.

Q: Why you need to automate the process of editing datum point definition?

 


Martin Hanák

View solution in original post

6 REPLIES 6
tbraxton
22-Sapphire I
(To:liz68)

Pro/Program is not the best approach to automate the import of data. I am not sure if it is even possible with Pro/Program.

 

If you structure the design intent of your model in a way that regenerates when importing new point data then you could use one of the API (Toolkit, J-Link etc.) to read in data but unless that is a function call in the context of a larger program, I don't see how it saves you any time when modeling.

 

You could create a mapkey to read in the points file and regenerate the model. This would enable updating the points with a button push. A mapkey would be my suggestion to deal with this.

========================================
Involute Development, LLC
Consulting Engineers
Specialists in Creo Parametric
liz68
6-Contributor
(To:tbraxton)

Thanks tbraxton for your reply.

I was thinking the same thing, but I was hoping it might work somehow with PRO/Program.

MartinHanak
24-Ruby III
(To:liz68)

Hi,

I tested trail method successfully.

 

Situation no.1

 

!
!       DATUM POINT ARRAY DATA FILE
!
! Comment lines should begin with an exclamation mark (!).
! You may have as many comment lines as you wish.
! There must be at least one space between values.
!
! Enter values with respect to datum arrays' coordinate system:
!
!CARTESIAN coordinates:
!        X                Y                Z
!
           0.00            0.00            0.00
          10.00           10.00            0.00
          20.00          100.00            0.00

 

MartinHanak_0-1680614055506.png

Situation no.2

 

!
!       DATUM POINT ARRAY DATA FILE
!
! Comment lines should begin with an exclamation mark (!).
! You may have as many comment lines as you wish.
! There must be at least one space between values.
!
! Enter values with respect to datum arrays' coordinate system:
!
!CARTESIAN coordinates:
!        X                Y                Z
!
           0.00            0.00            0.00
          10.00           10.00            0.00
          20.00          100.00            0.00
          30.00           30.00            0.00

 

MartinHanak_1-1680614137816.png

 

To be able to do this change, following trail file has to be generated and replayed.

Note: Below shown trail file works for my part, only.

 

!trail file version No. 1961
!Creo  TM  7.0  (c) 2023 by PTC Inc.  All Rights Reserved.
~ Select `main_dlg_cur` `PHTLeft.AssyTree` 1 `node3`
!Datum Point id 40
~ Command `ProCmdRedefine@PopupMenuTree` 
!ODUI session starting: Okit widgets are on, Undo/Redo on, Dashboard style off, Tab style on. Feature title : Datum Point
!ODUI session started.
!%CPSelect coordinate system to place points.
~ Activate `Odui_Dlg_00` `t1.UpdateBtn`
!results of editing PRT_CSYS_DEF.pts.1
@ edit
^!
^!       DATUM POINT ARRAY DATA FILE
^!
^! Comment lines should begin with an exclamation mark (!).
^! You may have as many comment lines as you wish.
^! There must be at least one space between values.
^!
^! Enter values with respect to datum arrays' coordinate system:
^!
^!CARTESIAN coordinates:
^!        X                Y                Z
^!
^           0.00            0.00            0.00
^          10.00           10.00            0.00
^          20.00          100.00            0.00
^          30.00           30.00            0.00

@ endedit
!%CPSelect coordinate system to place points.
~ Trigger `Odui_Dlg_00` `t1.CSysCollectorTbl` 2 `0` `c1`
~ Trigger `Odui_Dlg_00` `t1.CSysCollectorTbl` 2 `` ``
~ Move `Odui_Dlg_00` `Odui_Dlg_00` 2 28.957465 3.246038
~ Activate `Odui_Dlg_00` `stdbtn_1`
!ODUI session finished.
!ProgressBarDlg: Regen Started

 

 

Creo 7.0 model attached.

 


Martin Hanák
liz68
6-Contributor
(To:MartinHanak)

Hello Martin,

thanks for your answer.

This looks similar to mapkeys. Unfortunately I am not really familiar with using trails.

How can I create one for my case?

MartinHanak
24-Ruby III
(To:liz68)


@liz68 wrote:

Hello Martin,

thanks for your answer.

This looks similar to mapkeys. Unfortunately I am not really familiar with using trails.

How can I create one for my case?


Hi,

if you have "zero" experience with trail file then it would be better not use it. FYI ... when you start Creo session and do some work in it then almost every action is recorded into trail file. Its name is trail.txt.n by default. When you finish Creo session, you can rename the file and edit its contents. Later you can replay resulting file in next Creo session. This enables you repeat recorded actions.

I think if you search community web, you will find more information concerning trail files.

 

Maybe it will be enough if you write a procedure How to update the set of points into Word document and use this document, when you need it:

  1. open new datum point table in Notepad outside of Creo
  2. in Creo edit definition of point feature
  3. click Update button
  4. delete old point table
  5. copy new datum point table from Notepad
  6. save
  7. finish edit definition action
  8. regenerate model.

Q: Why you need to automate the process of editing datum point definition?

 


Martin Hanák
liz68
6-Contributor
(To:MartinHanak)

Hi,

thanks for the short explanation.
I will try to find a solution with mapkeys. If that doesn't work, I guess the best option is to write the procedure as you suggested.


A: I am working on a project where we want to parameterize and automate a 3D design (I am not allowed to give more details). For this purpose I am working with PRO/Program and mapkeys and the curve is used for the geometry of a part. CREOSON was thought as alterntiv but unfortunately was not approved by our IT.

 

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags