rog1n Posted April 1, 2020 Share Posted April 1, 2020 Hello, As said in title how I get the TAGs and Prompts from a dynamic block, but I want to get from a block is only inside the "insert block " not inserted on Model/Layouts. Is possible to do this or I can get TAGs and Prompts only from a entity? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 1, 2020 Share Posted April 1, 2020 1st step would be to use lee-mac dynamic block properties lsp, to a block that is inserted, second would be if I understand correct you have not inserted the block, if correct insert it get properties and then erase. 1 Quote Link to comment Share on other sites More sharing options...
rog1n Posted April 2, 2020 Author Share Posted April 2, 2020 1 hour ago, BIGAL said: 1st step would be to use lee-mac dynamic block properties lsp, to a block that is inserted, second would be if I understand correct you have not inserted the block, if correct insert it get properties and then erase. I understood your idea. Thank you Anyaway, so is not possible get the properties of a block only in the "library of blocks" (block insert)? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 2, 2020 Share Posted April 2, 2020 Its much easier to insert get properties then erase it as I said earlier it will be Blink speed. Or you may see nothing insert at 0,0. 1 Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted April 6, 2020 Share Posted April 6, 2020 Is this about dynamic block property values, attribute values, or attribute tags and prompts? 1 Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted April 6, 2020 Share Posted April 6, 2020 10 hours ago, Tor2o said: You can edit an attribute definition only before it is saved as part of a block definition. With Lisp you certainly can. 1 Quote Link to comment Share on other sites More sharing options...
rog1n Posted April 7, 2020 Author Share Posted April 7, 2020 7 hours ago, Roy_043 said: Is this about dynamic block property values, attribute values, or attribute tags and prompts? It's about attribute TAGs and prompts from a dynamic block, my question is if possible to get the attribute TAGs and prompts from a block is only inside here: Quote Link to comment Share on other sites More sharing options...
dlanorh Posted April 7, 2020 Share Posted April 7, 2020 13 hours ago, Roy_043 said: With Lisp you certainly can. My understanding from re-reading several times is the tags and prompts? from a block nested inside a dynamic block. 1 Quote Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted April 7, 2020 Share Posted April 7, 2020 8 minutes ago, dlanorh said: My understanding from re-reading several times is the tags and prompts? from a block nested inside a dynamic block. I think what he's asking is something like (getstring T "\nSpecify tag name: ") and then list all the blocks with that specific tag name. Unfortunately of all the posts I've done here and with my knowledge, I don't have a idea how to do that 1 Quote Link to comment Share on other sites More sharing options...
dlanorh Posted April 7, 2020 Share Posted April 7, 2020 2 minutes ago, Jonathan Handojo said: I think what he's asking is something like (getstring T "\nSpecify tag name: ") and then list all the blocks with that specific tag name. Unfortunately of all the posts I've done here and with my knowledge, I don't have a idea how to do that I think he needs to post a sample dwg. Quote how I get the TAGs and Prompts from a dynamic block, but I want to get from a block is only inside the "insert block " not inserted on Model/Layouts. Is possible to do this or I can get TAGs and Prompts only from a entity? I'm confident i'm in the same ballpark, but I don't understand the prompts as opposed to the tagstring. If it is the prompt you're going to have to access either the attribute definitions entity data (code 3) or attribute definitions object 'promptstring property Select the Block and loop through the entities to find the nested block or nentsel the nested block. Find its name or effectivename the get that block definitions from the block table/collection get the attributes and loop through extracting what you want. 1 Quote Link to comment Share on other sites More sharing options...
rog1n Posted April 7, 2020 Author Share Posted April 7, 2020 (edited) I will try explain better, I have a block in other DWG, this block have attributes. So I will use the Lee Mac steal from DWG to get this block to my present DWG. the Block is now in the list of blocks here: If you insert the block in the Model/Paperspace and double click show the "Attribute Editor" Now I can get the list of Tags and values from the block inserted, my questions are: 1- How I get the list of Prompts? 2-The suggestion of BIGAL works I inserted the block in coordinates 0,0 then extract that informations (only the Prompts I didn't get), but is possible to get the list of Tag, Prompt and Value without insert the block in Model/Paperspace? Edited April 7, 2020 by rog1n Quote Link to comment Share on other sites More sharing options...
dlanorh Posted April 7, 2020 Share Posted April 7, 2020 Not sure how you want to use it, but try this. It includes constant attributes that have no prompt string. (defun c:getblkpmpts ( / ent bname elst typ lst msg) (while (not ent) (setq bname (getstring "\nEnter Block Name ")) (if (tblsearch "block" bname) (setq ent (tblobjname "block" bname))) ) (setq elst (entget ent) typ (cdr (assoc 0 elst)) msg "") (while ent (if (= typ "ATTDEF") (setq lst (cons (list (cdr (assoc 2 elst)) (cdr (assoc 3 elst))) lst))) (setq ent (entnext ent)) (if ent (setq elst (entget ent) typ (cdr (assoc 0 elst)))) ) (foreach x (reverse lst) (setq msg (strcat msg "TAG : " (car x) "\U+0009 Prompt : " (cadr x) "\n"))) (alert msg) (princ) ) 1 Quote Link to comment Share on other sites More sharing options...
rog1n Posted April 7, 2020 Author Share Posted April 7, 2020 12 minutes ago, dlanorh said: Not sure how you want to use it, but try this. It includes constant attributes that have no prompt string. (defun c:getblkpmpts ( / ent bname elst typ lst msg) (while (not ent) (setq bname (getstring "\nEnter Block Name ")) (if (tblsearch "block" bname) (setq ent (tblobjname "block" bname))) ) (setq elst (entget ent) typ (cdr (assoc 0 elst)) msg "") (while ent (if (= typ "ATTDEF") (setq lst (cons (list (cdr (assoc 2 elst)) (cdr (assoc 3 elst))) lst))) (setq ent (entnext ent)) (if ent (setq elst (entget ent) typ (cdr (assoc 0 elst)))) ) (foreach x (reverse lst) (setq msg (strcat msg "TAG : " (car x) "\U+0009 Prompt : " (cadr x) "\n"))) (alert msg) (princ) ) Exactly this! Now I can adapt to my need. Thank you dlanorh. 1 Quote Link to comment Share on other sites More sharing options...
dlanorh Posted April 7, 2020 Share Posted April 7, 2020 7 minutes ago, rog1n said: Exactly this! Now I can adapt to my need. Thank you dlanorh. No problem, glad I could help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.