Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Populating title block with Material and Weight

Honored Contributor
Honored Contributor

@BenBroad  seems to make sense.  I will reply to my IR, with some specific questions, but to assist anyone else following this...

 

So I can remove these lines from my teamcente rmappings file?

	"DB_DWG_TEMPLATE_NX_Volume" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).volume /master=iman /description="Volume (in^3)"
	"DB_DWG_TEMPLATE_NX_Mass" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).mass /master=iman /description="Mass (lbm)"
	"DB_DWG_TEMPLATE_NX_Weight" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).weight /master=iman /description="Weight (lbf)"
	"DB_DWG_TEMPLATE_NX_Area" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).area /master=iman /description="Area (in^2)"
	"DB_DWG_TEMPLATE_NX_Density" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).density /master=iman /description="Density (lb/in^3)"

and just go with:

{Item type="CGR4_Item"
      "CGR_Mass" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).mass /master=iman /description="Mass (lbm)"
   }

Can this be expanded to Volume, Density, Area, and Weight? 

 

Thanks for your efforts!

-Dave
NX1867(if it had versions) | Teamcenter 11.6 | Windows 10

Re: Populating title block with Material and Weight

Siemens Esteemed Contributor Siemens Esteemed Contributor
Siemens Esteemed Contributor

Hi @DaveK,

 

Yes, all you need to do is remove the DB_DWG_TEMPLATE prefix to your mappings under UGPART, and also remove "NX_" (explained below).  I set mine to Mass, Density, Volume and Area.  Weight is not a property on the UGPART-MASSPR (UGPartMassPropsForm) form, so it does not map.

 

I set mine as follows:

 

{ Dataset type="UGPART"
    # (hard-wired) DB_DATASET_ID : "Part File ID"
    # (hard-wired) DB_DATASET_REV : "Part File Rev"
    # "DB_DWG_TEMPLATE_NX_Mass" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).mass /master=iman /description="Mass (kg)"
	{ Item type="CGR4_Item"
		"Mass" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).mass /master=iman /description="Mass (kg)"
		"Density" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).density /master=iman /description="Density"
		"Volume" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).volume /master=iman /description="Volume"
		"Area" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).area /master=iman /description="Area"
	}
}

 

I then defined the Part Attributes (Mass, Density, Volume and Area) in my drawing template as string attributes with empty values.  The reason you need to remove "NX_" is because you cannot create these part attributes in the drawing template (e.g. NX_Mass is a reserved attribute title).

I created a Note and using the Relationships option added references to each attribute, which gave the following:

 

Mass: <WRef2*0@Mass>
Volume: <WRef3*0@Volume>
Density: <WRef4*0@Density>
Area: <WRef5*0@Area>

 

Having creating a new part, I added some simple geometry and assigned a material to the body, saved the part and then created a new master model drawing (from my modified drawing template).   On saving the drawing the note updated to reflect the values from the model part.

 

Regards, Ben

Ben Broad | PLM Enthusiast | Siemens GCSS

NX (v17 - 1876) | Teamcenter (9 - 12)
Value Based Licensing | Adaptive UI | BETA Registration

Re: Populating title block with Material and Weight

Honored Contributor
Honored Contributor

Using your example, I could go with this, assuming this line, is actually commented out, with the #?

# "DB_DWG_TEMPLATE_NX_Mass" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).mass /master=iman /description="Mass (kg)"
	{ Item type="CGR4_Item

Actual code then:

{ Dataset type="UGMASTER"
    "DB_PART_NAME" : Item.object_name /write_once /description="Part Name"
    "DB_PART_DESC" : Item.object_desc /write_once /description="Part Description"


    { Item type="CGR4_Item"
        "site" : Item.cgr4_Site /description="site"
        "Year" : Item.cgr4_Year /description="Year"
        "SectionComplex" : Item.cgr4_SectionComplex /master=iman /description="cgr4_SectionComplex_toNX"
        "MeasuredWeight" : ItemRevision.cgr4_MeasuredWeight /master=iman /description="Measured Weight"
        "Materialdetail" : ItemRevision.cgr4_Materialdetail /master=iman /description="Material Detail"
        "IPN" : Item.cgr4_IPN /description="Internal Part Number"
        "CarType" : Item.cgr4_CarType /description="Car Type"
	"NX_Material" : ItemRevision.cgr4_Material /master=cad /description="Material"
    }

}

{ Dataset type="UGPART"
    # (hard-wired) DB_DATASET_ID : "Part File ID"
    # (hard-wired) DB_DATASET_REV : "Part File Rev"
	{ Item type="CGR4_Item"
		"Mass" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).mass /master=iman /description="Mass (lbm)"
		"Density" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).density /master=iman /description="Density"
		"Volume" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).volume /master=iman /description="Volume"
		"Area" : ItemRevision.GRM(IMAN_specification,UGMASTER).NR(UGPART-MASSPR).area /master=iman /description="Area"
	}
}

now, all of that said, if the office in Indy wants any of these listed in different units, they could alter the customer defaults at their group level, and enter in the attribute units?

-Dave
NX1867(if it had versions) | Teamcenter 11.6 | Windows 10

Re: Populating title block with Material and Weight

Siemens Esteemed Contributor Siemens Esteemed Contributor
Siemens Esteemed Contributor
Oh gosh, how did I miss that... so used to seeing the "hard-wired" entries I completely missed that one. Yes, you can take it out. Regarding the units - that's a whole new thread, but let me check Smiley Wink

Ben Broad | PLM Enthusiast | Siemens GCSS

NX (v17 - 1876) | Teamcenter (9 - 12)
Value Based Licensing | Adaptive UI | BETA Registration

Re: Populating title block with Material and Weight

Honored Contributor
Honored Contributor

And one more, just to clarify, in your original summary:

 

1) Create custom Item Type in BMIDE and add a property for material (cgr4_Material).

 

We have the custom item type already, what would I need to have looked for, to see if "cgr4_Material" is already there, in BMIDE?

-Dave
NX1867(if it had versions) | Teamcenter 11.6 | Windows 10

Re: Populating title block with Material and Weight

Siemens Esteemed Contributor Siemens Esteemed Contributor
Siemens Esteemed Contributor
Yes, the mapping is going to ItemRevision.cgr4_Material, so open the CGR4_ItemRevision business object in BMIDE, select the Properties tab and check to see if it has cgr4_Material defined.

I also tested the units. I was able to get this to work by setting Data Type, Dimensionality and Units when defining the Part Attributes in the Drawing Template. For example, for Area I set "Data Type = Number", "Dimensionality = Area" and "Unit = cm", which changed the value for my last part that I tested. I tried changing the Customer Default initially, but this didn't affect the values.

Regards, Ben

Ben Broad | PLM Enthusiast | Siemens GCSS

NX (v17 - 1876) | Teamcenter (9 - 12)
Value Based Licensing | Adaptive UI | BETA Registration

Re: Populating title block with Material and Weight

Honored Contributor
Honored Contributor

Ok @BenBroad I lied, one more question...

 

...once the mapping file is edited, and our TC admin installs it, how long until I can test if it works?  so I jsut need to restart my TC client, or will the TC server need a reboot?  or is it instant, ie active TC client will start using the new mappings?

-Dave
NX1867(if it had versions) | Teamcenter 11.6 | Windows 10

Re: Populating title block with Material and Weight

Siemens Esteemed Contributor Siemens Esteemed Contributor
Siemens Esteemed Contributor
Well, if you restart your TC client and your not seeing the changes then you'll have to restart the TC server Smiley Happy
I'm usually working on the TC server, so I have to restart each time I import the latest mappings.

Cheers, Ben

Ben Broad | PLM Enthusiast | Siemens GCSS

NX (v17 - 1876) | Teamcenter (9 - 12)
Value Based Licensing | Adaptive UI | BETA Registration

Re: Populating title block with Material and Weight

Honored Contributor
Honored Contributor

I have BMIDE now, so looking at the CGR$_ItemRevision, I see cgr4_Material exists, but it also on the Modifiable line, it has a check for "overridden", should this be a concern?

 

material_in_bmide.JPG

-Dave
NX1867(if it had versions) | Teamcenter 11.6 | Windows 10

Re: Populating title block with Material and Weight

Siemens Esteemed Contributor Siemens Esteemed Contributor
Siemens Esteemed Contributor
Mine is the same. I think it just means that your cgr4 template (child template) is overriding the foundation template (parent template). If you edit the property constant there's a checkbox for "Allow Override in Sub-business objects", which would allow a child template (beneath your cgr4 template) to override your constant. You should be able to find out much more information on this by selecting "Help > Dynamic Help" from within BMIDE.

Regards, Ben

Ben Broad | PLM Enthusiast | Siemens GCSS

NX (v17 - 1876) | Teamcenter (9 - 12)
Value Based Licensing | Adaptive UI | BETA Registration