- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
create a thousand separator in mass parameter
hii
I need to add a comma in the BOM in the mass of the part.
like if the mass of a part in an assembly is 5055 lbs then I need it to be shown as 5,055 lbs in the BOM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @anuj16797
I don't know of a way to do this with built in Inventor settings, but I suppose you could create some custom code for this.
Here is a past post concerning creating a custom iProeprty to handle a format change for the mass.
https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/custom-properties/m-p/4808383#M48457
The syntax to add the thousands separator would be something like this:
Dim oValue As Double = 88888888888888 If oValue > 999 Then oMsg = oValue.ToString("###,###") End If MsgBox(oMsg)
If you have questions about how to implement this via code, I would suggest creating a new post on the customization forum and asking those questions, and linking back to this topic for reference.
https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/bd-p/120
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
it solved half of my problem but i still need your help.
As shown in the below image I need to calculate the unit weight of each part with a thousand separators and "NA" if the mass is less than one which is done.
but now I need the extended weight which is (UNIT WT * QTY) with a thousand separators and "NA" if the mass is less the one in unit wt.
.
If iProperties.Mass > 999 Then iProperties.Value("Custom", "Totalmass") = iProperties.Mass.ToString("###,###") iProperties.Value("Custom", "UNIT WT") = iProperties.Mass.ToString("###,###") Else iProperties.Value("Custom", "UNIT WT") = Round(iProperties.Mass, 0) End If If iProperties.Mass < 1 Then iProperties.Value("Custom", "UNIT WT") = "NA" iProperties.Value("Custom", "EXT WT") = "NA" End If