+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Forum Newbie
    Using
    AutoCAD LT 2018
    Join Date
    Apr 2017
    Posts
    4

    Default Automatically update fields from specific object with one action

    Registered forum members do not see this ad.

    Hi everyone,

    I have a quite a specific question relating to auto-filling fields that are inserted into text.

    To give you some context I work in the lighting design industry and draw 2D lighting layout plans. I am currently trying to build a collection of dynamic blocks which contain attributes relating to their reference letter, circuit number, location, etc etc. This bit I have done quite easily. I plan to use these attributes to export to excel later, again something I already have working.

    The way our company labels the light fittings on plan is to use a leader. However if I have already given the block the information it requires for it attributes (and excel usefulness) I don't want to spend time typing it all out again in the leader. I have inserted some fields into my leader that recall the information I have stored in the block attributes but it is probably slower to insert them and click through the Field dialogue box than it is to just type in manually!

    What I want is to be able to have a generic leader with the fields that will refer to any given block (using the same names for those attributes) that when, for example the tip of the leader arrow touches a specific block the fields know that is the object they need information from, that way I don't have to right click each field and re-select the block manually. I just need a way of making this a one action process for each leader instead of having to do it for each field within it.

    I hope this makes sense to someone, more than happy to try and explain better if not!

    Many thanks,

    Matt

  2. #2
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2017
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,055

    Default

    I don't think that is going to be possible in LT. In order to get a field to read the value within a block yoou have to use the field dialoge box and the select object option. And in LT there is no way to bypas the dialogue box in a macro or script, you can start the field command from a macro but that isn't going to help you because you still need to physically click on the select object box, then select an object, then choose which property you want to use etc. etc.
    What you should be able to do is make a block that already has your lighting block and a leader created with the necessary fields. And this block should inserted with the automatic explode enabled (you can do this with a macro). Then you can update the block info as needed and it's associated leader will update accordingly (after a regen of course)

  3. #3
    Forum Newbie
    Using
    AutoCAD LT 2018
    Join Date
    Apr 2017
    Posts
    4

    Default Automatically update fields from specific object with one action

    Ah okay, yeah having LT has thwarted so many of my ideas! haha

    Hmm, that sounds promising though. I must admit my first thought was to perhaps make the leader a part of a dynamic block but having only just got into dynamic blocks etc myself I couldn't work out how to achieve it. I have not used the macros before either.

    Would you be able to explain/show or point me in the direction of a resource that shows me how such a block might be put together? Would it help if I uploaded the block and leader I have so far?

    Many thanks.

  4. #4
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2017
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,055

    Default

    Both options would work, and yes it would be a great help if you could upload a sample, just incase there are any oddities.

  5. #5
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2017
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,055

    Default

    Attached is just a very simple example, First I created the "symbol" block then a leader that had 2 fields to read the 2 attributes from the block, and combined both these into the "Nested" block.
    If you save the dwg then you should be able to just drag the block onto a toolpalette, (though sometimes this plays up if it is a new palette) or copy and paste onto a palette, failing that copy paste or drag onto an existing palette and then copy from there onto a new palette usually works. Once on the palette right click and choose properties look down the list and set explode to yes, the nice thing about having your blocks on a palette are all the other properties that you can preset (so for example you can have it setup with a named layer and your blocks are always placed on that layer), anyway try it and see if this looks promising, any questions then post back.

  6. #6
    Forum Newbie
    Using
    AutoCAD LT 2018
    Join Date
    Apr 2017
    Posts
    4

    Default

    Thanks for your continued support and advice, I really appreciate it. I can't seem to see an attached file to your last post? Am I missing something obvious? Sounds good though, can't wait to see it - I can see if I can adapt it into my existing one and send back if I have problems?

    Thanks again

  7. #7
    Luminous Being Dadgad's Avatar
    Using
    AutoCAD 2013
    Join Date
    Nov 2011
    Location
    At the confluence of worthlessness & invaluability
    Posts
    5,973

    Default

    As is usual steven-g coming to the rescue with some good ideas, unfortunately, you are correct, the attachment does not seem to have come along for the ride.
    Volume and repetition do not validate opinions forged in the absence of thought.

  8. #8
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2017
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,055

    Default

    Oops I think scatterbrain maybe a good nickname (i'm sure my ex could come up with some better ones), sorry about that, I think I forgot to attach the attachment and left it on the drive way, so I just popped back to pick it up. I hope it goes someway to helping.
    Attached Files

  9. #9
    Forum Newbie
    Using
    AutoCAD LT 2018
    Join Date
    Apr 2017
    Posts
    4

    Default

    Registered forum members do not see this ad.

    Haha, no worries Steven - thank you so much for putting that together it definitely looks like it's along the right lines. When I get a quiet moment I will play around with it properly and try and integrate it into the blocks I have already and share the result might come in handy for others trying to achieve a similar result.

Similar Threads

  1. Lisp inserted Mtext (w/fields) not automatically updating
    By lfe011969 in forum AutoLISP, Visual LISP & DCL
    Replies: 17
    Last Post: 7th Oct 2010, 11:30 pm
  2. Set dialog preferences automatically in AutoCAD action macro
    By hosannabizarre in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 8th Jul 2010, 07:01 am
  3. update Fields
    By beemaya in forum AutoCAD Drawing Management & Output
    Replies: 7
    Last Post: 1st Apr 2009, 08:29 am
  4. Tutorial: Use fields to automatically label dynamic blocks
    By AutoCAD Tips Blog in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 8th Nov 2008, 11:40 pm
  5. Update Fields
    By zars in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 25th Oct 2006, 05:38 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts