Skip to main content
1-Visitor
June 25, 2024
Solved

Drawing parts list parameters using description or common name

  • June 25, 2024
  • 4 replies
  • 2009 views

Using Creo 9.0....I have some legacy parts that were named with the description parameter and all my new parts have been named with ptc_common_name parameter. Is there a way for my drawing parts list to pull either name if i have an assembly with both new and legacy parts? I was thinking of adding a repeat region relation that is along the lines of the code below. Also, i don't want to modify the original part files. Is there a way to do this because my way isn't working.

 

/NAME is new drawing parameter for the name column

If description exists

NAME = asm.mbr.description

endif

If ptc_common_name exists

NAME = asm.mbr.ptc_common_name

endif

Best answer by pausob

Note that once the CAD file is uploaded to Windchill, it will have the PTC_COMMON_NAME parameter...

So therefore I'm pretty sure your repeat relation pseudo-code will always result in the PTC_COMMON_NAME being reported in the repeat region table.

 

I'd try something like this:

IF exists("asm_mbr_DESCRIPTION")
 NAME = asm_mbr_DESCRIPTION
else
 NAME = asm_mbr_PTC_COMMON_NAME
endif

 

See this online help page for repeat relations that involve: testing whether a parameter exists in a model.

4 replies

21-Topaz II
June 25, 2024

Basing an IF statement on the existance of the ptc_common_name parameter is not helpful. As far as I know that parameter always exists,

I'm also uncertain if your syntax is correct for affecting a bill of materials column. Maybe someone who does a lot of this type of thing will chime in with some helpful tips.

pausob19-TanzaniteAnswer
19-Tanzanite
June 25, 2024

Note that once the CAD file is uploaded to Windchill, it will have the PTC_COMMON_NAME parameter...

So therefore I'm pretty sure your repeat relation pseudo-code will always result in the PTC_COMMON_NAME being reported in the repeat region table.

 

I'd try something like this:

IF exists("asm_mbr_DESCRIPTION")
 NAME = asm_mbr_DESCRIPTION
else
 NAME = asm_mbr_PTC_COMMON_NAME
endif

 

See this online help page for repeat relations that involve: testing whether a parameter exists in a model.

24-Ruby III
June 26, 2024

Hi,

AFAIK PTC_COMMON_NAME parameter is present in all Creo models (Windchill usage is not a necessary condition).

Test: add following relation temporarily, verify relations and look at testpar value

testpar=PTC_COMMON_NAME

 

Repeat region table cell must contain &rptr.rel.NAME callout.

 

14-Alexandrite
June 26, 2024

I am using this code, since I am using windchill but you can substitue asm_mbr_wt_docname with your asm_mbr_ptc_common_name. There is also protection if the parameter of description is empty, since some guys kept forgetting filling the description parameter. So we had parameter in start model but nobody manually filled it.

 

 

if exists("asm_mbr_description") 
	table_name = asm_mbr_description
	if asm_mbr_description == ""
	table_name = asm_mbr_wt_docname
	endif
else
table_name = asm_mbr_wt_docname
endif

 

 

 

In region put in rpt.rel.table_name ofc

Community Moderator
July 4, 2024

Hi @GS_9490468,

 

I wanted to follow up with you on your post to see if your question has been answered. 
If so, please mark the appropriate reply as the Accepted Solution. 
Of course, if you have more to share on your issue, please let the Community know so that we can continue to help you. 

 

Thanks,
Anurag