Submitted by sam17 on Sat, 07/13/2013 - 05:02
Forums:
hi,
Dim measure As MeasureBodyBuilder
'Dim nxobject As NXObject
Dim extrude As TaggedObject
'Dim bd As Body = CType(w.Bodies.FindObject("EXTRUDE(2)"), Body)
measure = w.MeasureManager.CreateMeasureBodyBuilder(extrude)
MsgBox(measure.ToString)
just wanted the measured value from msgbox ?
re: value
In interactive NX, the measure body function returns lots of values. Which values are of interest to you?
currently i'm able to extract
currently i'm able to extract below
x = mass, area, volume, centroid, radius of gyration data from msgbox(measurebodies.x) e.g. msgbox(measurebodies.volume).
You may search for the object you need under NXOpen folder -> MeasureBodies header file.
However, i still couldn't extract the entire object information. Any kind soul can enlighten?
Besides that, if I only want the centroid in x direction only, what can i do?
re: extracting measurement info
What version of NX are you running?
Also, can you post a short code snippet of what you have?
For the centroid X coordinate try:
Dim centroid_x as double = [measurement object].Centroid.X
I'd recommend that you use
I'd recommend that you use either NXOpen.UF.UFModl.AskMassProps3d or Snap.Compute.MassProperties. Either of these will give you the entire set of available results. The NX/Open function returns a mysterious array of 47 doubles, and you'll have to refer to the docs to find the values you need.
Also, be aware that the NX/Open function returns values wrt the WCS, not the ACS (which is highly unusual, for an NX/Open function).
The SNAP function is better documented, and easier to use, and it also works on mixtures of solid and sheet bodies.
Measure
Hi, how could i catch the diameter of a sphere?
I have been searching and i found this code (theSession.Information.DisplayObjectsDetails(objs) ), but i'm not sure if it's the right
re: measure
Do you have a reference to a "Sphere" feature, or a spherical face? If it is the feature, you can use the "SphereBuilder" class to get the diameter information. Other methods would need to be used if it is not an actual sphere feature.
What version of NX?
Measure Spherical Diameter
If you're looking to measure the diameter of a spherical feature you can also use "Resize Face" in synchronous modeling. When you click on the spherical surface it defaults to the current diameter.