Skip to content

round trip assembly materials when loading from step file #1954

@shimwell

Description

@shimwell

When making assembly objects I am making use of the option to add materials like this

import cadquer as cq
result = cq.Workplane().sphere(5)
assembly = cq.Assembly()
assembly.add(result, material=cq.Material("mat1")) 

I would be keen to then save this assembly to a step file and load it up again later.

assembly.export("assembly_step1.step")

I am then loading it up and looking for the materials but the "mat1" is not found in the assembly anymore. I have tried two ways

from cadquery import importers
cadquery_object = cq.Assembly().importStep('assembly_step1.step')
cadquery_object = importers.importStep('assembly_step1.step')

for child in cadquery_object.children:
    print(child.material)

The child doesn't appear to have a material attribute.

I would be keen to be able to round trip the assembly so that I can save and load and get the same assembly back when loading

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions