Jump to content

How to create a block with object references in a formula field using autolisp or scripting


brandalf_the_semiGray

Recommended Posts

I'd like to be able to create a block with four nested blocks, a rectangle and a circle in the center(see attached). Actually creating the shapes won't be too hard. The part that I'm unsure how to do is the fact that I need to attach a formula calculation to some text attributes that reference pairs of the nested blocks to calculate slope between them. Is it possible to write a routine that will attach the references to pairs of the nested blocks, as well as fill out the formula with those references? 

 

Is this something better approached with a simple script, or a VBA routine? I'm in the early phase of brainstorming my plan of attack right now. Long term, I'd like to be able to use dimensions referenced from an excel file, and then generate my block based on those while assigning an explicit name to the block. The blocks will be accessed by another lisp routine that I've written which will access them (by name), refresh the slope values, and then evaluate whether the slopes meet the user supplied bounds.  I'm trying to take the name dependency out of this process as best as I can since there will potentially be several variations of the block in a drawing. They will have different width dimensions, and a slightly different name to identify them, which means the routine I've written to change the color will need to be able to select several blocks of different names which means that I need to be able to control the names of the blocks as tightly as possible. 

 

Whew. Long winded explanation... Anyways. I have a working routine that can search a dwg for the different names, now I just need to be able to generate the blocks automatically. If someone has some resources they can point me towards, or some knowledge/advice I'd appreciate it.

 

TS_FOUNDATION REV5.dwg

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