Jump to content

Automatically update fields from specific object with one action


matt220992

Recommended Posts

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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. :beer:

Link to comment
Share on other sites

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.

OneClick.dwg

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...