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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Translate the entire conversation x

Is there wayto extract named Co-ordinate systems from a published lightweight cad

RP_9497568
4-Participant

Is there wayto extract named Co-ordinate systems from a published lightweight cad

I need to extract named coordinate system and its values from cad assembly. I know there are methods available in creoparametric toolkit. But it become inefficience considering number of cad and size of cad. 

Is there a possible way to extract the details from published light weight binary files (OL).

Saw some methods in Creoview toolkit 

ACCEPTED SOLUTION

Accepted Solutions

Similar question - "How to export a CSV file containing point coordinates from a section path?": https://community.ptc.com/t5/Analysis/How-to-export-a-CSV-file-containing-point-coordinates-from-a/td-p/780850 

View solution in original post

6 REPLIES 6

Similar question - "How to export a CSV file containing point coordinates from a section path?": https://community.ptc.com/t5/Analysis/How-to-export-a-CSV-file-containing-point-coordinates-from-a/td-p/780850 

RPN
17-Peridot
17-Peridot
(To:RP_9497568)

In Creo I would traverse the assembly, get the transformation matrix of each component, visit any csys feature in this components, and multiply this with the matrix, finally export this 4 points to a file.

You need  the assembly in a Creo session, else you don’t have the transformation. Without Creo - I have no clue, but with a light weight simplified representation this may possible as well, not sure about this. In Tcl I would think to solve this in about 45 minutes. 

 

 

 

RP_9497568
4-Participant
(To:RPN)

Thanks for the suggestion.

 

I can able to do with creo session or creo toolkit.  but was looking from converted/ published files

 

 

RPN
17-Peridot
17-Peridot
(To:RPN)

For what it's worth ...

 

 

# Synchronous mode with an active assembly
# Task: Transform the first found csys to world coord of the active assembly
# assumption each model has minimum one csys and skip assemblies
# ps_vist components -> will return a list of {COMP_N PATH_To_COMP_N COMP_N+1 PATH_To_COMP_N+1 ...}
# ps_assy matrix_get - default is -bottom_up yes get the matrix by the pathObj
# ps_visit csys returns the Geom IDs of each Csys in a given model, lindex 0 the first csys found
# ps_geom to_feat Type ID -> get the Feature ID of the GeomId
# ps_feat name FeatureID - the name of the feature ID
# ps_data csys csysObj -> the csys data Origin X,Y,Z Vector ...
# Csys transform Materix ResultCsys ->  Origin X,Y,Z Vector transformed
# Csys origin,xvector, yvec ... -> a 3dPointObj
# pObj 3d_val - the numerical values
proc CSYS_Transform_Test {} {
    set del ", "
    set ASSY [ps_model current]

    set fp         [open c:/temp/$ASSY.csv a+]
    puts $fp     [join {Component CompPath CSysID OX OY OZ XX XY XZ YX YY YZ ZX ZY ZZ} $del]

    ps_comppath compPathObj
    ps_matrix     matrixObj
    ps_csys     csysObj
    ps_csys     csysTransObj

    foreach {MODEL PATH} [ps_visit components] {

        if {[ps_model is_assembly -model $MODEL]} continue

        compPathObj    config -path $PATH

        ps_assy matrix_get compPathObj matrixObj

        set firstCsys     [lindex [ps_visit csys -model $MODEL] 0]

        set featID        [ps_geom to_feat -model  $MODEL csys $firstCsys]
        set featName     [ps_feat name -model  $MODEL $featID]

        ps_data csys -model $MODEL $firstCsys csysObj

        csysObj transform matrixObj csysTransObj

        csysTransObj origin     Po
        csysTransObj xvector    Px
        csysTransObj yvector    Py
        csysTransObj zvector    Pz

        set doubVals     [concat [Po 3d_val] [Px 3d_val] [Py 3d_val] [Pz 3d_val]]
        set formVals     [eval format [list [string repeat "%.3f " 12]] $doubVals]
        set csvVals        [concat $MODEL [list $PATH] $featName $formVals]

        puts $fp [join $csvVals $del]

    }

    close $fp
}

 

 

csys_transform.png

RP_9497568
4-Participant
(To:RPN)

Is it possible to retrieve the same information from Creo view toolkit from Ol/Pvs file? I managed to do it using CreoParametric toolkit. Requirement is to extract it from OL.

RPN
17-Peridot
17-Peridot
(To:RP_9497568)

Sorry but here I’m less then a newbie😫

Announcements

Top Tags