NX attribute Information - Unit
NX attribute Information - Unit
(OP)
Hi -
I am trying to extract the "unit" from a NX Part attribute.
It seems like regarding the documentation - it should be possible to ask for the Unit - but I am not sure how to - and to extract the unit as a string...
code start:
theSession.ListingWindow.Open()
For Each a_part As Part In theSession.Parts
theSession.ListingWindow.WriteLine(a_part.Leaf & " attributes:")
For Each attr_info As NXObject.AttributeInformation In
a_part.GetAttributeTitlesByType(NXObject.AttributeType.Any)
theSession.ListingWindow.WriteLine(attr_info.Title & " = " & a_part.GetStringAttribute(attr_info.Title))
'theSession.ListingWindow.WriteLine(a_part.GetStringAttribute(attr_info.unit) ' seems not to work
Next
theSession.ListingWindow.WriteLine("")
Next
code end:
Maybe one of you have a suggest or a solution - or just a hint - which can guide me in the direction of success..
Lklo
I am trying to extract the "unit" from a NX Part attribute.
It seems like regarding the documentation - it should be possible to ask for the Unit - but I am not sure how to - and to extract the unit as a string...
code start:
theSession.ListingWindow.Open()
For Each a_part As Part In theSession.Parts
theSession.ListingWindow.WriteLine(a_part.Leaf & " attributes:")
For Each attr_info As NXObject.AttributeInformation In
a_part.GetAttributeTitlesByType(NXObject.AttributeType.Any)
theSession.ListingWindow.WriteLine(attr_info.Title & " = " & a_part.GetStringAttribute(attr_info.Title))
'theSession.ListingWindow.WriteLine(a_part.GetStringAttribute(attr_info.unit) ' seems not to work
Next
theSession.ListingWindow.WriteLine("")
Next
code end:
Maybe one of you have a suggest or a solution - or just a hint - which can guide me in the direction of success..
Lklo





RE: NX attribute Information - Unit
CODE
www.nxjournaling.com
RE: NX attribute Information - Unit
Thank you for your fast reply...
I just tried to "play" with your solution - but it seems like it still not possible for me to extract the Unit of part attribute..
I will try again tomorrow.....
lklo
RE: NX attribute Information - Unit
I did figure it out using the attr_info.Unit.Name.
I just needed to build in a small exception, so only if the attribute has a unit, program should ask for the unitname.
Thanks again...
lklo