Jump to content

Update Attribute values if block moves etc..


hardwired

Recommended Posts

Hey all,

 

I am trying to adapt a block with attributes that will change the attribute value based upon its Y coordinate, so if the user moves the block, the value will dynamically change..

 

I have been sent a block (for Northing and Easting coordinates) someone did ages ago that seems to change its attribute values based upon the insertion point (you have to regen the drawing for this to update but still, it works :))

 

The block I want is for level datum info, so will use the Y coordinate. I have create the block, which is dynamic (only as it has got flips and stretches) but just want this block to act like the other one..

 

Reverse-Engineering the block i was sent, the Value of the attributes state InsertionPointmN and InsertionPointmE (for north and east respectively) which seem to be variables of some description. Its not VBA as there is nothing i can see in the VBAIDE so must be some other scripting or coding to it but dont know what. It seems just a standard AutoCAD block..

 

Any ideas how this could have been created and how i can do it for my own block?

Link to comment
Share on other sites

It sounds to me like those are FIELDS, based on what you say about how to trigger the FIELDEVAL command, which defines the trigger for update field values.

If you start the FIELD command, it will start you down the road to seeing how it was done.

The FIELD will contain an ATTRIBUTE derived from a selected OBJECT in the drawing. :)

 

From what you have said about the older block, it does not sound like it is a dynamic block, although it could be, as

a FIELD could have been added to an ATTRIBUTE in either a regular block or a DYNAMIC one, but I would guess not,

if that is the only behavior which seems dynamic.

definition of your field.jpg

Edited by Dadgad
Link to comment
Share on other sites

Hey Dadgad,

 

That's the kitty. Looks like thats what the other block has. I'll investigate further so thanks very much for the pointer (if you excuse the pun)..

 

I think this will work fine for any level datum block we insert into ModelSpace but for the ones in PaperSpace, this might be an issue - Basically I have previously written a program that allows the user to pick a point in MS, which in most cases is while in PS (the program goes into floating modelspace mode, the user picks the point in the viewport, then it goes back to PS. Then the user can insert the level datum block with it attribute values formatted to +0.000 in PS, which works perfectly well.. Its just i wanted to add the flexibility to the block that if the levels are revised for the project, the block can be moved and the value for the levels updates automatically thus avoiding any forgetful errors on the users part by not changing the value themselves. Sorry the long-winded spiel, just wanted you to have a background on what i'm trying to achieve :)

Link to comment
Share on other sites

Just so long as your FIELDEVAL setting is set appropriately (31 covers all the bases),

you shouldn't need to worry about forgetting to change them. They won't change realtime,

but as you can see from the attached image they will likely update very soon, as soon as any of the triggers is pulled. :beer:

 

A DATE field would need to be updated with the UPDATEFIELD command, all of the rest are self updating.

Other types of DATE format fields will update automatically, such as SAVE DATE,

and CREATION DATE.

set your fieldeval to suit.JPG

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