Jump to content

Assign Integer/Double value to Dynamic Block Custom Property


JonHilll

Recommended Posts

I am trying to link the actual value of the length property of a polyline with a custom property I've created in a dynamic block. Basically, I would like to be able to link the property line length with a call out block that contains the line's length as "Count" property (Dbl). I've created a custom property to hold the numeric value (i believe this should be a Double value in order to sum values in table?) so I can then sum all lengths of similar call out blocks in a table.

 

The reason I am using a custom property is so I can specify it as a Double value so the values will be able to sum up in the table. Using fields, I can link the poly line length to an attribute field but this becomes a string object which I can't add together in the table, as far as I understand anyway.

 

What changes would I need to make to Lee Mac's awesome Lisp routines (huge fan of yours, Lee) to add this feature? I've attached the lisp file with the sub routines that seem useful for this task included, but I have quite a bit of trouble putting it all together. I've reverted all of Lee's subroutines back to the original code so none of my customization causes any errors.

 

My end game is simple: Select the poly line(s), select the dynamic block to be associated with said line(s), and then populate the custom "Count" property with the length of the selected poly line(s) as a Double value. This will allow me to summarize the total length using data extraction and a table. Any help with this would be greatly appreciated, and please include the why & how if you have the time so I can learn and share with others :)

 

You guys are the best, thanks in advance!

 

 

 

 

Count.lsp

PROP_CO_1.dwg

Link to comment
Share on other sites

Have you given any thoughts to the fact that the value of your Dynamic Property will not automatically update if the length of the polyline changes?

Link to comment
Share on other sites

Have you given any thoughts to the fact that the value of your Dynamic Property will not automatically update if the length of the polyline changes?

You are absolutely right Roy, I am used to using fields for extracting information but I did expect there to be an issue with automatic updating. Having said that, would there be a sub routine I could use to include the dynamic block in regen/open/save/plot updates?

Link to comment
Share on other sites

AFAIK there is no built-in way to synchronise dynamic properties with properties of other entities. To accomplish this you would have to roll out your own reactor based application. My advice would be to stick to fields and try to find a different workaround for the problem.

 

I use BricsCAD which has a _DataExtraction command with fewer options.

But perhaps you can add a row to the table and display a field with a Lisp variable there? To define the Lisp variable and keep it synchronised you can use code similar to the code you can find here (note: the code was written for BricsCAD and will not work in AutoCAD without modifications).

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