Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Goal: One drawing format which will populate specific data and not matter if the drawing model is a single part or an assembly.
Using a repeat region I am trying to pass model material along with a few other items into a title block. I can successfully make this happen by
Is there a way to use repeat region relations in order to have a single format with a repeat region which works if the drawing model is a part or an assembly? I'm not sure if it is even possible, or if I simply am having an issue with syntax and formatting.
Try using
IF asm.mbr.type == 'prt'
use part parameters
endif
if asm.mbr.typ == 'asm'
use assembly parameters
endif
Sadly, no such luck.
The following relations will verify in the drawing of an assembly but does not work on drawing repeat region. The same relations in a drawing of a part will not verify and result in errors.
if asm_mbr_type == 'PART'
test = mbr_ptc_material_ptc_material_name
endif
if asm_mbr_type == 'ASSEMBLY'
test = asm_mbr_ptc_material_ptc_material_name
endif
Explain the difference between part and assembly parameter😵
Do you have different formats for this 2 solid types? 😵
I want to know if it is possible to have a single format which can be used for both parts and assemblies.
Part: Basic sheetmetal part
Assembly: Basic sheetmetal part with hardware pressed in
Both the part and the assembly share the same part number but the drawing of the assembly is the ordered finished good. My current solution to the trying to pass the default material parametric into the title block is to make everything an assembly (so even if the ordered sheetmetal part doesn't have pressed in hardware, just make it an assembly) that way asm.mbr.ptc.material.ptc.materal.name functions all the time.
I'm curious if it is even possible to have this function without making everything assemblies with some kind of if/then/else relation. Instead of having two different formats.
