Jump to content

Block Replacement with Attribute Transfer


Unadrafter

Recommended Posts

Hi. I work with HVAC drawings. When converting a CAD file into an "existing conditions" format for showing demolition and "new-to-existing" connections, I frequently have to replace air device "tag" blocks in drawings with different ones that show only the airflow through the devices. As there can be several hundred of these blocks in a project, I'm endeavoring to write a lisp routine that will automate this replacement, The tag name we use for the airflow value is the same in both the "new equipment" and "existing condition" versions of the block. So, what I'm trying to learn to do is:

 

1) Create a selection set of all "ID_HEX*" (yes, a wildcard, to allow for different drawing scales) blocks. This part, I have accomplished.

 

2) Replace these blocks, one at a time, with a "ID_CFM*" (The wildcard corresponds to the value of the "HEX" block it replaces, for scaling,) and transferring the airflow value from the deleted block to its replacement. Each replacement would be inserted at the insert point of the "hex" block it replaces.

 

As I stated, I've gotten as far as creating the selection set of all the "ID_HEX*" blocks that have a "XXX" tag, but that's as far as I've gotten. I still have to write the routine that goes through the selection set, extracts the insertion point and flow value from each block, and inserts its replacement block, using these two values.

 

Any assistance anybody would be willing to share would be greatly appreciated. I understand the concepts of what I need to do, but the heavy-duty stuff is still a little beyond me.

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