Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
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.
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.
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.
Hi rcrerar-2,
Regarding the Transform measurement function. Any idea what is the equivalent VB API?
Thanks in advance.
Hi Sorry no idea