CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.092.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator. New AutoCAD 2026 commands and variables.

CAD tip CAD tip # 12105:

Question

CAD 
 %  platform  category 
A
With the freeware utility MinOf you can select the smallest or largest object from the selection set, by a specified property (e.g. Area, Length, Volume, Elevation, Scale…).

Download the MinOf utility from DL Download, load it into your AutoCAD with APPLOAD and start it by typing the MINOF or MAXOF command.

The first prompt asks for the drawing object type, this will also influence the next property set:

Specify type of compared objects [Any/Line/Polyline/anYline/clOsedpoly/Circle/Text/Insert/Hatch/Solid/poiNt/Bbox].

"Any" will accept any type of object, "anyLine" allows Lines, Polylines and Splines, "clOsedpoly" allow only closed LWpolylines, "Solid" means 3D Solids, "Bbox" will compare bounding boxes of the selected objects.

Then you will select the source objects for the comparison (or Any for all of that type).

The next prompt lists all common numeric properties for the selected object types (analyzes the first of them). You can also type any other property if you are familiar with the DWG objects. The "Centroid" property means "Z-coordinate of the centroid", the "strlEngth" pseudo-property is a computed string length (number of characters), the "attriBute" property allows to select a numeric block-attribute to compare, the customizable "cUstomprop" is described below.

The last prompt asks for choosing the Minimum (smallest) or Maximum (largest) object - compared by the selected property. The resulting object or objects will be selected - e.g. the shortest line, room with the highest number, etc.

Since V1.5, the commands MinOfCurve/MaxOfCurve or the option Vertex in MinOf will identify the minimum or maximum value of a X/Y/Z coordinate on the selected curve (polyline, spline, helix) - either from all its points or just from its vertices or as a local extreme, just between two selected points. The extreme point(s) will be highlighted with the Point entities in the layer "MinOfCurve".

You can use MinOf or MaxOf either separately (grip-selects the specified object), or inside any other command invoking it on the "Select objects:" prompt by typing the transparent command 'MINOF or the LISP command (C:MINOF). See:

The special property "cUstomProp" can be used to process and compare any other object property. You will first need to define a custom function which will handle this parameter. This LISP function must be called "MinOfCustomProperty", has a single parameter, object ID and should return a number - the value of the custom-defined property. See examples:

;sample 1: string length
(defun MinOfCustomProperty (obj / prop)
	(if (vlax-property-available-p obj 'TextString)
	 (setq prop (vl-catch-all-apply 'vlax-get-property (list obj 'TextString)))
	 (setq prop nil)
	)
	(if prop (setq prop (strlen prop)))
)

;sample 2: distance of block from a given point
(defun MinOfCustomProperty (obj / prop)
 (if (not _minoflocal)(setq _minoflocal (getpoint "\nPick reference point: ")))
	(if (vlax-property-available-p obj 'InsertionPoint)
	 (setq prop (vl-catch-all-apply 'vlax-get-property (list obj 'InsertionPoint)))
	 (setq prop nil)
	)
	(if prop (setq prop (distance _minoflocal (vlax-safearray->list (vlax-variant-value prop)))))
)
ACAD
100% *CAD
8.1.2019    20429×  
Share the tip:
Digg it! Del.icio.us Facebook Twitter Google bookmark Technorati StumbleUpon
applies to: AutoCAD ·

See also:
Tip 14499:How to place Revit families exactly on a terrain surface (elevation, orientation)?
Tip 14446:Undocumented options in AutoCAD FIELDs - hyperlinks, hexadecimal or binary format
Tip 14443:Connector, notch, groove, cutout or other curve- breaks - easily with dynamic blocks.
Tip 14392:How to get rid of the dot displayed by P&ID symbols in Plant 3D?
Tip 14250:How to select all lines of the same length or boundary polylines of the same area?


Back    All CAD Tips



Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD: 
OS: 
Categ: 
Text:
 FAQ
  



Featuring:
Increase your productivity with our set of add-on functions for AutoCAD Civil 3D
CADstudio Civil Tools More info


Please use these tips at your own risk.
ARKANCE is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist