Jump to content

LISP and Dynamic Block Properties


rwsice9

Recommended Posts

Does anyone know if it is possible to use LISP code to do these 3 things:

1. Insert a block (this is about as far as I can get myself)

2. Read a variable value (Useri5, for example)

3. Set a lookup table value based on the variable value.

I have a bock with a lookup table with selectable values from 1-40. The block is for revision text on a drawing. The lookup table changes the block's attribute values to read off of Sheet Set custom properties. I already have a couple of functions for inserting a revision delta and have the number automatically populate based on the USERI5 variable, but I would also like to be able to have a function to insert the revision text block, and have it automatically set to the correct revision number.

If anyone could help (or think you might be able to help, but my explanation was confusing) please please let me know. Thanks for reading my post and taking time to help out!:D

Link to comment
Share on other sites

Does anyone know if it is possible to use LISP code to do these 3 things:

 

1. Insert a block (this is about as far as I can get myself)

2. Read a variable value (Useri5, for example)

3. Set a lookup table value based on the variable value.

 

Yes, this is possible.

 

Please post the code you have so far, and a sample REV block (2004 file format) if you can.

 

I have a bock with a lookup table with selectable values from 1-40. The block is for revision text on a drawing. The lookup table changes the block's attribute values to read off of Sheet Set custom properties.

 

What do you mean by lookup table? Is this a list of grouped pairs in your code, perhaps?

 

I already have a couple of functions for inserting a revision delta and have the number automatically populate based on the USERI5 variable, but I would also like to be able to have a function to insert the revision text block, and have it automatically set to the correct revision number.

 

No need for the USERI5 storage.

 

I too have a function which inserts a REV, but programmatically searches a selection set of REV blocks, and filters for the highest revision value (i.e., 1, 2, 3, or A, B, C, etc.) and prompts me to use the currect (highest) value, or to increment the value by one.

Link to comment
Share on other sites

I am posting the revision text block and the lisp code that I use for inserting the revision delta (I dont have any written so far for the revision text block, but I was thinking the code would be similar to the delta code.)

 

What do you mean by lookup table? Is this a list of grouped pairs in your code, perhaps?

 

I think I may have mis-worded this. The correct term would be a Block Properties table. Similar to a visibility state, but lets you select default values for attributes within the block. You'll see when you download the block. No code at all.

 

 

REV1T40-E1.dwg

tri.lsp

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