AutoCAD 2013/2014/2015

AutoCAD 2013/2014/2015

Reply
Active Contributor
RJAHouston
Posts: 36
Registered: ‎03-11-2010
Message 1 of 6 (354 Views)
Accepted Solution

Dynamic Fields in Blocks ??

354 Views, 5 Replies
08-29-2012 10:29 AM

I was curious:

  Is there a way that i can put a Field in a block that does not have a locked down specific item to look for?  What i'm trying to do is  have a block that contains a field linked to an object (Polyline) and read its length.  My problem is that when you put a field in a block you have to define what it is looking for so if i select "Object" in the field its asking for that object while i'm in the block editor, is there any way to have it pause for user input so that i can select the object after the block has been inserted?

Distinguished Mentor
steven-g
Posts: 537
Registered: ‎05-11-2009
Message 2 of 6 (351 Views)

Re: Dynamic Fields in Blocks ??

08-29-2012 11:01 AM in reply to: RJAHouston

If you can create the field first before you make the block, so it references the polyline. Then create your block including the field, it should work ok.

Otherwise you could use an attribute inside the block. And once you are back into the drawing you can edit the attribute and insert a field into it's value that points at your polyline. If you could be a bit more specific on how you need to use it, I could probably give you a better idea. Can you post a drawing with an example.

Regards Steven Gray
Setting Out (Joinery Manufacturing)
Autocad 2013LT
Windows 7 professional
Active Contributor
RJAHouston
Posts: 36
Registered: ‎03-11-2010
Message 3 of 6 (347 Views)

Re: Dynamic Fields in Blocks ??

08-29-2012 11:11 AM in reply to: RJAHouston

I dont know how to explain it better.  We use travel distance blocks that read out how far a travel distance is (Polyline Length) 

 

I use a block with an attribute in it now but that means i have to insert the block - Select the line to get distance - then enter distnace manuallu into attribute.  That takes alot of time and if the length changes i have to manually change data

 

I cant put a field in a block and have it ask me to select the object.  I have to use a text string and right click to insert field then select the object.  I have attacjed a sample drawing but there really isnt much to it.  the top one is an example of how i have a rectangle with a field string inside and the bottom block is an attributed block that has to be manually updated, i usually have between 5-10 travel distances in each drawing.  

*Expert Elite*
dbroad
Posts: 1,551
Registered: ‎08-16-2007
Message 4 of 6 (342 Views)

Re: Dynamic Fields in Blocks ??

08-29-2012 11:28 AM in reply to: RJAHouston

No.  Fields do not support prompting, even fields in attributes.

 

You could create a custom command to do it but none exist in AutoCAD.  AutoCAD Architecture implements the process built-in by using property sets and multi-view blocks in a process called tagging.

 

You could probably get some nice LISP writer on the customization group to do it free.  Otherwise hiring someone to customize that would be relatively economical.  I could do it but am trying to cut down on free-work.  Try your local vendor.

Active Contributor
RJAHouston
Posts: 36
Registered: ‎03-11-2010
Message 5 of 6 (336 Views)

Re: Dynamic Fields in Blocks ??

08-29-2012 11:43 AM in reply to: dbroad

thank you.  Its not important enough for me to ask someone else to write up a script.  I was just seeing if there was a way already in AutoCAD that i could do this.  Again thank you

 

Distinguished Mentor
steven-g
Posts: 537
Registered: ‎05-11-2009
Message 6 of 6 (328 Views)

Re: Dynamic Fields in Blocks ??

08-29-2012 12:34 PM in reply to: RJAHouston

I'm afraid I can't help you any more than that, unless someone can give any hints for using a lisp routine, AFAIK you can not insert a block and get it to link to another object automaticaly. You have to do that by hand. You can use the attributed block but rather than adding the info by hand, when you double click on the block and open the attribute editor, go to the value and right click, this will let you add a field - select your object and it is now linked. You may need to do a regen but changes to the polyline will show up in the attribute, so you won't have to do it manually.

  Thinking out loud, if you create a block linked to a very short polyline 1" for example (it will work with a point zero length, but that is hard to pick and anyway how accurate do you need to be), then when you need it, copy this short polyline and it's block to your distance polyline. Make sure the endpoints touch and are on the same plane then JOIN the two polylines (selecting the short one first) then regen to update the field.

  In the attached drawing the top part has the short line positioned at the centre of the circle (zoom in to see it), and the middle part is after the JOIN command has been issued.

  PS I'm on a roll here. The lower part is a block called Test, insert it at the end of your polyline explode it and join it. Job done. You could create a macro that will automatically insert and explode a named block and also issue the join command for you, so all you would need to do is a few clicks. 

  Sorry if I started rambling but the idea developed as I was writing the reply and I kept popping back to try it out.

Regards Steven Gray
Setting Out (Joinery Manufacturing)
Autocad 2013LT
Windows 7 professional
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.