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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to set a default attribute with CREO MODELING

Matteo_1987
15-Moonstone

How to set a default attribute with CREO MODELING

I set a default value which should fill in the field on creation (see photo 2)
Creating a wt part without the cad is ok
Creating a Cad Document with Creo Parametric is ok (see photo 1)
When creating a Cad Document with Modeling the fields with the default value are not filled in (see photo 3).

 

How to set a default attribute with CREO MODELING?

 

Matteo

7 REPLIES 7

Hi @Matteo_1987 

 

It works only if you create CAD document from a web Wizard in workspace.

 

If you create CAD from Creo the default value is not propagated from Windchill to model.

 

You need to specify the default value in a start model which is used to create model.

 

PetrH

Dobi
14-Alexandrite
(To:HelesicPetr)

@HelesicPetrI'm running into this too but don't quite understand the mapping intent. Perhaps you can clarify. 

 

CS117198 clarifies that "Default values are only honored for create UI" - so the New Cad Document wizard in the workspace will apply the default value set in type attribute. 

Ok. Makes sense. 

 

That seems to run into some conflicts when you consider attribute/parameter mapping though.

From Help Center here (for NX, specifically but it would apply equally to other CAD) it goes through mapping a CAD application attribute to a Windchill attribute through name matching. If in the CAD application start part the EXACT SAME value exists for the attribute as is the default specified in type attributes, Windchill doesn't take the CAD application NOR applies it's default and instead leaves the attribute blank when the file is first saved to the workspace. 

 

Wouldn't the expected behavior be that if the incoming explicitly mapped attribute value - manually entered though it may be - exists on the list of allowed values and is the default AND allowed value, that it should pass to Windchill?

 

For the case where you specify the default value in a start model which is then used to create other models, even though the correct value is specified in the parameter in CAD,  it doesn't go to Windchill without requiring the secondary "Edit/Attributes" unless I'm missing something. 

 

Dobriša

Dobi
14-Alexandrite
(To:Dobi)

I found what I was missing, at least in the enumerated list case.

 

If the CAD start part has the attribute mapped and the default value of the attribute in CAD is the INTERNAL NAME of an attribute on the list instead fo the display name, then it works (at least in Creo and NX). 

Dobi_0-1696699168258.png

 

@Matteo_1987 , I'm not super familiar with Creo Modeling but if the behavior on this aspect of it is the same as is in Creo or NX try putting in the Internal Name as the text in your CAD model. The attribute looks to be already explicitly mapped.

If you need to set always a default value, you also can set the value by OIR:

 

<AttrValue id="ATTRIBUTE_XYZ" algorithm="wt.rule.algorithm.StringConstant">
   <Arg>VALUE</Arg>
</AttrValue>

 

Dobi
14-Alexandrite
(To:BjoernRueegg)

@BjoernRueegg that would take effect on Upload. If a file is created just in CAD (File/New) and there's a value already assigned in the start part model I think is what the issue is (at least in so far as what I observed). 

 

Would the OIR overwrite a CAD set default on upload? 

OIR rules for any attribute are only applied if the value of that attribute is null. If the value is not null, this is for one of two reasons :
1. the create wizard or other part of the system always sets a value, or
2. the value is based on a native type (such as a number) that cannot be null, and the system does not explicitly invoke the OIR rule for that attribute.

You just can set it in the OIR so you don't need to modify the start part. If somewhere a value is provided, the OIR won't override any value.

Top Tags