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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Export coordinate system values to excel

JerryLim
6-Contributor

Export coordinate system values to excel

Hi all, 

Need help to export user selected coordinate system X,Y,Z values to excel or text file. Values are needed to calculate differences between 2 coordinate points.  

Currently able to select only.[Snippet of the code]

'===========================================================
Allows user to select coordinate system
'===========================================================
Dim selectMe As CpfcSelections
Dim selectionOptions As IpfcSelectionOptions
Dim vbResult As VbMsgBoxResult
Set sOS = New CCpfcSelectionOptions

Set selectionOptions = sOS.Create("csys")
selectionOptions.MaxNumSels = 2
MsgBox ("Please select the require coordinate system!"), vbOKCancel
If vbResult = vbCancel Then
MsgBox ("User click cancel. Exit Sub.")
Exit Sub
Else
Set selectMe = session.Select(selectionOptions, Nothing)

'======================================================================
'     User need to select a 'csys' (controls goes to CREO)
'======================================================================
If (selectMe Is Nothing) Or (selectMe.Count) = 0 Then
MsgBox ("Nothing Selected!")
Else
MsgBox ("Coordinate System Selected!")
End If
End If

Thanks in advance.

5 REPLIES 5
tbraxton
22-Sapphire I
(To:JerryLim)

Does the calculation of the distance between points have to be done in Excel? Creo can measure it directly.

 

Use the measure distance function and select the CSYS you want to use as your reference frame. The result will give the resultant vector as well as x,y,z components. If you open the information window in the measure tool dialogue box then you will get text results which you can export as text.

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

Hi tbraxton,

 

Thanks for the reply. My idea was to shorten this process of getting the coordinate values after selecting it. The user do not have to open the information window to retrieve the results. Instead, once the coordinate systems are selected, the results will be automatically exported. 

 

Do you know which specific vb API functions i can go towards making this process?

 

Thanks in advance.

 

Hi, A number of years pipework around an engine. As you can imagine being exact was an issue so I ended up using the Transfrom measurement. This accurately measures between two coordinate systems and can produce an output file. The output file can then  be pulled into another model to give you start and end points.  use coordinate system/ offset type/ from file. Note also this measure gives rotational values too which can be important when lining up components.

 

Also once read in to the model there is no link to the file so they are stable until read back in.

 

Hope this helps.

JerryLim
6-Contributor
(To:Roy_Crerar)

Hi rcrerar-2,

Regarding the Transform measurement function. Any idea what is the equivalent VB API? 

Thanks in advance.

Hi Sorry no idea

Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags