Smart Leader

leader
 Plugin AVC_Leader for AutoCAD and BricsCAD
 MLeaders looking for an object under the arrow and fill the text for itself.


Normal multileader (MLeader) will be much smarter when you turn on this program. The multileader will be able to search the objects in the drawing under the place where their arrow points. In order to make a smart leader enough to create the normal multileader and to leave the text blank. Or enter a question mark ‘?’. Or you can type a special code word (substitution) instead of a multileader text. And if under the multileader arrow will find something valuable, the multileader text was miraculously replaced by a description of the found object. You can avoid a lot of mistakes and your work will be reduced to a couple of clicks!

The leader will be able to find:
  • The blocks with names. If the block has normal name (not A$...), then the leader will show the block name. 
  • Any attribute of the block. You can specify attribute to look for. Or write the attribute name right when you enter the leader and surround it with characters ‘%’. You can use hidden and constant attributes.
  • Any parameter of dynamic block. Like the attributes, just specify the name of the parameter between the% characters.
  • Solids. Leader measure solid and write information about it. For example, the dimensions of the part.
  • Surfaces of solids. The leader can display information about the specified part face: color, material, area and perimeter.
  • For all other objects, the Smart Leader can show the standard properties (color, layer, material), as well as properties added by the plug-in Names (Name, Kind, Info)
  • The leader will find objects even if they are hidden in the model for the viewport and the leader is in paper space. 
  • The leader can look for the most deeply buried objects within blocks and external references. This feature can be disabled in preferences. 
Smart Leader features:
  • With the ALD command, you can quickly place multiple leaders, making only 2 clicks on each leader and not using the keyboard.
  • The Smart leader will change the text if you move the arrow to another object of the drawing or if you move the entire leader using commands to _Move, _Copy, etc. 
  • The Smart Leader can themselves create AutoCAD Fields that link to an object under the arrow. The Fields are updated when the properties of the object are changed.
  • The program works with different styles of MultiLeader. For each style of setting their own. Do not forget about the _MLEADERSTYLE command.
  • You can make smart leader with text or with a block at the end (text/block content), if the block has attributes.
  • To avoid errors, the program can highlight found objects. 
  • The Smart leaders easily turn off if they at some point interfere with work. 
  • Flexible settings allow you to optimize the program for your needs. 
All the Smart Leaders can be updated by one click, without suffering the search for changes. And the leaders remember not the object to which they originally pointed, but the search settings. And when you update the leader, it looks for the object under the arrow again (if it's left there), and maybe the leader will find another object and replace itself with the text. This makes it possible to exclude heavy cases when the arrow of the leader shows one detail, and the text describes a completely different one.

The program interacts well with the plugins Names, Lay and Sawing Table. Once entering the part names in the properties of the solids, you can quickly place them on the leaders of the Assembly drawing and exploded drawings, and Sawing Table. Measurement of the solid follows the same rules as in the Sawing Table, regardless of the rotation of parts in space.

According to your request I can optimize the command for the standards of your company, to teach it to look for a sawing-table on layouts, insert a table format you need, etc. Offer your price. 

Download the plugin in the AVC_leader_nnnn_nn.7z archive. You can use the program for free, but from time to time the activation window will appear. If you donate at least $15, you can disable this window.

Automatic assignment of part numbers in the Assembly drawing. Using names of solids and measurement of solids. Leader placed in paper space. Finding solid highlight in all viewports.









Demonstration toggle search for objects inside blocks. When  InBlock option OFF search displays the name of blocks. And when  ON search displays the name and dimention of solids.













Octanorm Maxima

Demonstration using Smart Leader with Dynamic Block. Parameter "Length" added to leader. It use Octanorm Maxima for demo.














 

The GIF to demonstrate the quick installation of Smart Leaders. You can see one of the ways to apply the "Many objects" option. The last leader showed the properties of all three polylines, listing them through a comma.









See how you can use the "Face of solid" option in the Smart Leader (ALD) command. The demonstration shows how to use them to refer to coating, painting and edge materials. I pre-created two leader styles, in order to quickly switch the settings of Smart Leaders. Then I uploaded several materials from the AutoCAD library into the drawing and changed their names. I appropriated the materials to the solids of the shelf model. And I appropriated other materials to individual faces of solids. This is easily done, just select the face by clicking CTRL and change the material in the properties panel.









Recensione video in italiano registrata da Paolo Coter.


Commands

  • ALD - Abbreviation for AvcLeaDer. Dialog for setting of Smart Leader and then quickly placing leaders in 2 clicks
  • -ALD - Minus version of the settings. Works in the AutoCAD console. When smart leader are enabled, you can quickly place leaders.
  • LeaderUpdate - Update all smart leader on all sheets.
  • AVCMessage - Auxiliary command for setting output of messages about the progress of the program. In the trial mode, the activation window is displayed.

Usage Instructions

To create a smart leader you need use standard AutoCAD command _MLeader (MLD), specify the insertion point and leave the text empty. This will signal the program that you need to mark the leader as "smart" and start finding objects under the arrow. As the same signal you can enter the text ‘?’ or letter ‘n’ (from ‘name’ word) or any text with one of the substitutions, enclosed in percent symbols ’%’. After that the leader will always be considered "smart" and will be updated on command LeaderUpdate.

Note that the intelligence of leaders is not like yours. The leader may find nothing or find not what you expected. If the leader has not found the object, the text will be replaced with the template. To avoid errors the found object is highlighted. 

Please be aware
  • Use only one of the topmost object. Hidden under it are not taken into account. But you can turn on the search option "Many objects"
  • In the usual mode, you can (and need to) put the leader in the center of the surfaces of solids, where there are no edges. Even if AutoCAD does not display the surface (the wireframe mode), the program will still find a solid.
  • If program configured to find inside blocks, but the inner object has no name (or other specified parameter), then the leader will display the block name.
  • Measurement of the solid follows the same rules as the program Sawing Table: measured dimensions of the smallest box which will fit it solid. You can mark the solid as the sweep (Plugin Names required).
  • When you change the drawing, the content of the leader itself will not change. Use the LeaderUpdate or AVCUpdate command to update smart leaders.
  • A multileader can have a few arrows, but for finding objects use only first one. If you are adding arrows to the leader, the object will be searched under the first (oldest) arrow. When you delete the first arrow the program will look for the object under the remaining arrow..
  • Nothing is impossible to find on the view made by the ViewBase command. The fact is that such views do not reflect your details, but a special hidden block. Therefore, for using Smart Leaders use viewports on layouts, but not ViewBase.
  • Special leaders of AutoCAD Mechanical add-on do not grow wiser either. I strongly do not recommend using my plug-in in conjunction with AutoCAD Mechanical.
The program can display many properties of objects found under the arrow of the leader. To select the properties you need, use substitutions. Standard substitutions are described here. If the program does not find the standard substitution, it will look for a block attribute with that name or dynamic block parameter. All substitutions are written only in small letters. And attributes of blocks should be written in the same register as they are written in the block.

Follow the messages on the console. There may be program messages. 

Native search method

There is a built-in search function for drawing objects below the point that the user clicked in AutoCAD. Emulating clicks is very strange and so I wrote my own version of the object search. But I'm not sure about its stable operation, so I left AutoCAD users with the option to switch to the native search mode. 
Native search has a number of features:
  • Does not work in BricsCAD
  • Always ignores annotations, but not annotative blocks.
  • Finds only 1 topmost object and can not find all objects below the point.
  • It is impossible to select surfaces of solids.
  • In the 2D Wareframe mode (visual style) it is obligatory to indicate part contour lines. In the center of the circle will fail. Use EndPoint snap. But it mode you can make a leader from internal (unseen) parts.
  • In the shadow modes (any except 2D Wareframe) you can find solid, poking it in the midst of the faces. But it is impossible to find the invisible objects and will not work for any 2D objects.
  • Emulating a click requires switching the sheet and displaying all the objects on the screen, so updating all leaders will switch all the sheets and will overwhelm the current view.
  • Switch to the native search globally for all leader styles. You can not set one style to normal search, and another to native.
Use the native search only if the main method causes problems.

Blocks-Leader

As you know in AutoCAD, you can create 2 types of leaders: with text content or with a block content. The block is usually used to enclose the part number in a circle or in a square. For such leaders, a special block containing attributes is created in the drawing (automatically or manually). Nobody interferes with creating a block with several attributes and attaching it to the leader.
The Smart Leader program works with all types of leaders. If the block contains only 1 attribute, then working with such leader is no different from working with text leaders. You can configure such smart leaders in the ALD command dialog, and you will have the opportunity to configure 3 templates at once for one leader style: a solid template, a block template, and a template for other objects.
For leaders with multi-attribute blocks, you'll have to use the block editor (_BEdit) to insert the templates into the default values ​​of each attribute.
It is recommended to mark the Preset property of all block attributes so that AutoCAD does not open the attribute value input window every time you create a leader. And of course the program will not work with Constant attributes.
The attribute Tag does not matter.

 ALD command

The command serves for setting smart leaders. You do not need to call it every time you create leaders. Call the usual AutoCAD command _MLeader. The ALD command opens the settings dialog:



All smart leader settings are tied to the current leader style. Use the _MLeaderStyle command to create new styles of conventional and smart leaders. You can switch the current leader style directly in the settings dialog. To do this, at the top of the dialog, there is a drop-down list with all the styles of the current drawing.
Keep in mind that the settings are stored not in the drawing, but in the Windows registry, so they will be used in all drawings that have a leader style with the same name.
  • Enable Smart leaders - you can turn off the search for objects for some multileader styles.
  • Search in blocks - Enable search within blocks and external links. The deepest buried object will be found. Those if there is an external link under the viewport, there is a block in it, there is another block in it, there is solid in it, then the leader parameters will be solid.
  • Blinking hightlight - shows the object found under the leaders. The found object will be highlighted in order to avoid errors. You can turn it off if the blinking light prevents you.
  • Native search method - Use the old method of searching for objects under the leader built into the AutoCAD. The method does not allow to find many objects at once, it does not allow selecting subobjects. The search depends on the settings of the visual style. However, it works quickly and does not cause fatal AutoCAD errors.This setting is common for all leader styles. Not possible in BricsCAD.
  • Not Annotations - Ignore annotations under the leader. Will be excluded: 
    • annotation objects (texts, mLeaders, dimensions, tables, views, hatches, centerLine and centerMark)
    • all objects on the Annotation, Hatching, Axis and Viewport layers
    • annotative blocks
  • Face of solid - Output properties of subobjects: surfaces, edges, vertices of solid. Each face of the solid can have its own color, material, area and perimeter. The rest of the properties will be taken as usual from the solid. Use this option for mark materials of coating, edges, etc.
  • Many objects - Output on one leader a description of all the objects that will be under the arrow, and not only the top one.
  • Separator - Use the delimiter character between object descriptions. Use \P to move to new line (\P will only work in text MLeaders, but not in single-line block attributes).
  • Default format for - here you can specify three lines that will be applied to an leader when you leave the text/attribute empty or enter the question mark "?". A template for solid objects, for blocks and for all other objects is separately set up. 
  • For convenience of inserting substitutions from the right of the template field, there are drop-down lists with all substitutions. Place the cursor in the desired position of the template and select the substitution from the list. In the list for blocks there are all attributes of the current drawing. But there are no block parameters, although the program works with parameters too - I just did not find a way to extract them in this list.
Below in the settings dialog you will see the Common Options panel of all A>V>C> commands. Smart leaders are affected by the size formatting and the use fields. Also, measurements of solids are affected by the tolerance settings and the right angle priority. For details, see the Common Options page. Common Options apply to all leader styles at once.

When you click OK the program starts to cyclically request from you pairs of points to create new leaders. You do not need to enter text. And generally it is not required to touch the keyboard. The texts will be filled in programmatically. To stop the operation, press Esc instead of entering a point.

-ALD command

Configures smart leaders from the console (command line) AutoCAD, without opening a dialog. Only the current leader style is configured. To switch the style, use the standard AutoCAD tools. Have options:
  • On/Off Temporarily disable smart leaders and enable them back. And start quick leaders placement. To stop the operation, press Esc instead of entering a point.
  • SolidTemplate – String for solid description template. Can contain substitutions and any litters. Return to default use %
  • BlockTemplate – String for block description template. By default %n% - the block name. Also acceptable substitutions and any attributes and parameter of the block.
  • OtherTemplate - Template for all other objects.
  • InBlock – switcher for finding inside blocks and external references. Default No.
  • Highlight switcher for highlighting found objects. Default Yes.
  • NotAnnotation switcher for ignore annotations. Default Yes.
  • FaceOfSolid switcher for showing subobject properties. Default No.
  • MultiObject switcher for finding all objects under arrow. Default No.
  • DimentionFormat - Enter string for control the number of decimal places and insignificant zeros. The setting is common for all multileader styles. See the Common Options page for details.
At the end of the operation, the command will call the usual command to create a multileader _MLeader. The settings are saved in the Windows registry for HKEY_Current_User. 

LeaderUpdate command 

Refreshes Smart Leaders. Leaders must be selected in advance or the program will request a choice. You can order the program yourself to find all the smart leaders on all sheets of the drawing. Command looking objects under leaders arrows and refills the text in accordance with the template stored in the multileader Info property. The remaining settings are used at the time the command is executed. If the leader arrow has nothing or if specified parameters not found, the command will display at the end the number of failed leaders. The text of the failed leaders will set like the template (usually the question mark ‘?’).

AVCMessage command

Auxiliary command for setting output messages about the progress of the program. In the demo mode it shows the activation window.

Known Issues

  • If you copy smart leader by _Copy command then automatically update only the first copy. Other copies can be updated by the command LeaderUpdate 
  • I recommend disabling the AutoCAD option "Make new dimensions associative" (system variable DIMASSOC should put 1 instead of 2) because when it is enabled, leaders behave unpredictably. It has nothing to do with the work of my plugin. 
  • When you display the sizes of objects inside the blocks, the block scale is NOT taken into account. Those if you call _Scale for a block, or change the ScaleX property of the block, all the dimensions of the parts inside the block will remain old! Unit Factor is also not taken into account.
  • There are features and limitations on the use of fields in leaders. Details can be found on the Substitution page.
  • Notes and symbols AutoCAD Mechanical't know how to disable their visibility and therefore tightly close the objects. (The problem occurs when using the native search method).
  • One user encountered damage to DWG files by using Smart Leaders in Mechanical 2017. I strongly do not recommend using my plug-in with the AutoCAD Mechanical add-in.

Versions

next
    New substitution for drawing properties.

2019.5

    SmartLeader commands is able to work with perspective viewports.
    Settings dialog are now correctly displayed in the Windows font scaling mode (on displays with abnormal DPI: 4K monitors and high-resolution laptops).

2019.3.4

    AutoCAD 2020 compatibility
    New Activation method

2018.12

  • Fixed error BoundaryRepresentation.Exception on some solids.
  • Warning message on Perspective viewports

2018.11

  • Fixed error on MLeader ContentType NoneContent and ToleranceContent
  • Fixed eNullObjectId on drawing with external reference

2018.10.3

  • New substitution %info% or %i% - description of block

2018.10.2

  • Fixed: error on clipped viewport

2018.10

  • Fixed: error eRegappIdNotFound 

2018.9.2

  • Fixed: error NullReference if same 2 point for MLeader

2018.9.1

  • New substitution %id%
  • Fixed: error object order in blocks

2018.9

  • A new method for finding objects under the arrow of the leader: independence from the display mode, ignoring the back objects, searching for subobjects
  • New options Not Annotations, Surface of solid, Many objects
  • Quick leaders placement
  • Compatible with BricsCAD
  • Updated setup dialog and configuration command

2018.5

  • New substitutions %area% and %perimeter%. Now you can write the lengths of curves and the area of closed polylines on smart leaders.
  • The Red Ghost is removed. He too often caused a AutoCAD fatal errors. But the blinking highlight now works with objects inside the blocks.
  • A warning has been added when trying to work with Model Documentation views.

2018.3

  • Compatible with AutoCAD 2019

2017.12

  • Individual settings for each leader style
  • The leader with the block content (on the end) grew smarter - now you can put the part numbers in circles.
  • There was an opportunity to set a lot of attributes in the block at the end of the leader and fill them with different properties for different templates
  • New way to highlight objects - Blinking selection
  • Settings Dialog on command ALD
  • Switch leader styles in the settings dialog
  • Drop-down lists with substitutions for easy template customization
  • A separate template for "other objects"
  • New command -ALD for console configuration
  • Now, instead of the values ​​of the properties of objects, substitutions can be replaced with AutoCAD Fields
  • New option in Common Options: Use fields

2017.3

  • Compatible with AutoCAD 2018
  • New version numbering
  • New activation window
  • New substitution - %asymv%, %tech%, %thickness%
  • Fixed: Error “accore.dll” on AutoCAD 2017 and 2018 x32

2.5

  • Fix: eWasErased

2.4

  • New solid measurement algorithm (right angle priority)

2.3

  • Fix – LeaderUpdate can’t update leader outside of screen and some over case.

2.2

  • Material like solid property

    2.1

    • Correct name for dynamic block
    • Show any dynamic block parameter
    • Fix error in function getting attributes from dynamic block

    2.0

    • AutoCAD 2017 compatibility
    • Demo version
    • Support Texture solid property (from Names 2.0 plugin)
    Comments