How do i get bounding box of a surface

How do i get bounding box of a surface

per.soerensen2EV6F
Advocate Advocate
632 Views
5 Replies
Message 1 of 6

How do i get bounding box of a surface

per.soerensen2EV6F
Advocate
Advocate

I found this "PowerMill Parameter Reference" but i cant get to work.

"$lims = limits(entity('model', 'my model').hierarchy.components)" 

I have a list of selected surface names that I like the XYZ limits of.

*******************************************************************************************

array limits( entity ref )
array limits( string type, string name )
array limits( object object )
array limits( data data )

The entity parameter must be either an nc program, toolpath, boundary, pattern, featureset or model.
The object parameter must be a block map.
The data parameter must contain a ModelCompList or ModelCompSet. Otherwise an error will be returned.
The Toolpaths must be calculated before calling this function. Otherwise, the Toolpath / NC Program limits will be invalid / will not be accounted.
Returns an array of 6 real values that hold the XYZ limits of the entity. The returned array can be used to initialize or assign to another array or list.
The limits are computed with regards to the active workplane. If it's required to be computed with regards to a specific workplane, use the limits_workplane_rel() function.

Example:
REAL ARRAY lims[] = limits(Boundary)
$lims = limits('model','my model')
$lims = limits(Toolpath.block)


$lims = limits(entity('model', 'my model').hierarchy.components)

*what do i add here, to get values for one surface ?


NOTE that the returned values in the array are as follows
array[0] = Minimum X value.
array[1] = Maximum X value.
array[2] = Minimum Y value.
array[3] = Maximum Y value.
array[4] = Minimum Z value.
array[5] = Maximum Z value.

0 Likes
633 Views
5 Replies
Replies (5)
Message 2 of 6

clifford.gage
Enthusiast
Enthusiast

What are you trying to do? What is a bounding box.

Is it just to create a boundary of a surface?

0 Likes
Message 3 of 6

per.soerensen2EV6F
Advocate
Advocate
The "limits" command gives you the max min value in X,Y,Z of a object.(bounding box)
It is like using the "BLOCK" but without having to reset the BLOCK after.
0 Likes
Message 4 of 6

clifford.gage
Enthusiast
Enthusiast

yes I get what you are doing, yeah I just select the surface or object and make a block 

0 Likes
Message 5 of 6

kevin.hammond3WX4X
Advocate
Advocate
0 Likes
Message 6 of 6

per.soerensen2EV6F
Advocate
Advocate

Thanks

This do not work if you are working with no popups or gui.

I now several workarounds but why cant I use  "limits('model','my model').surface.name"

0 Likes