Skip to content

Getting part name and part origin location from assembly step file #1003

Open
@iantferguson

Description

@iantferguson

I have an assembly step file and I'm trying to return the part names and part origin locations with respect to the top-level assembly origin. I've tried something like this for getting origin location but all three parts come back as (0.0, 0.0, 0.0):

step_reader = STEPControl_Reader()
step_reader.ReadFile('./test_assy.stp')
step_reader.TransferRoots()
myshape = step_reader.Shape()

it = TopoDS_Iterator(myshape)
while it.More():
   shp = it.Value()
   trsf = myshape.Location().Transformation()
   print (trsf.TranslationPart().Coord())
   it.Next()

I'm also not sure if it's more appropriate to use XCAF and something like ShapeTool which I've seen in some assembly examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions