ILoveMadoka Posted September 13 Posted September 13 Starting with this code that I found from Tharwat (defun c:foo () (setq StyleName "MyTableStyle") ; Prompt user for table style name (setq dic (cdr (assoc -1 (dictsearch (namedobjdict) "ACAD_TABLESTYLE")))) ; Get the TableStyle dictionary (if (dictsearch dic StyleName) ; Search for the specified Table Style in the dictionary (prompt "\nTable Style exists.") ; If found, display this message (prompt "\nTable Style does not exist.") ; If not found, display this message ) (princ) ) How can I assign all the tables that meet that criteria to a selection set? I was hoping it would be as easy as (setq ss (ssget "_x" '((0 . "ACAD_TABLE") (302."MyTableStyle"))) ) but that does not work. I do not know how to incorporate extended entity data I would like to replace this (prompt "\nTable Style exists.") ; If found, display this message (prompt "\nTable Style does not exist.") ; If not found, display this message with if found make a selection set else exit. How can I also find tables located inside of blocks and make part of the selection set? (which I would also like to incorporate but only secondary) QSelect does not find tables within blocks either.. Quote
BIGAL Posted September 14 Posted September 14 I am not sure that you can get a table using a style name with ssget, but you can get all tables and look inside at the table name. two ways dxf or VL. Then make a new selection set or list of entities. (setq sty (cdr (assoc 3 (entget (cdr (assoc 342 (entget (ssname ss X )))))))) (setq obj (vlax-ename->vla-object (ssname ss x))) (setq sty (vlax-get obj 'StyleName)) Inside blocks much harder need to use entnext and find the table inside the block, will leave that to some one else. Quote
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.