• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

reading visible attributes in dynamic blocks

  • Thread starter Thread starter Giuseppe Beatrice
  • Start date Start date

Giuseppe Beatrice

Guest
Good day to all.
I have dynamic blocks for which some attributes are visible only in a state of visibility and not in others.
is it possible to examine the above blocks with autolisp, extracting only the visible attributes and not the invisible ones or however distinguishing the two different types?
Thank you in advance how many will help me.
 
View attachment Blocchi attributi invisibili.dwgin the attached file I entered the block twice with its two visibility states.
As you can see, the attributes inserted must occupy different positions, since once the block must connect with the general picture (not designed) and another time with another instance of the same block represented in the first state of visibility.
I would need to know, with the extract lisp, what are the attributes actually visible in the current visibility, in order to be able to compile them correctly, semza compile those invisible.
 
; list of visible attributes (tag . value)
(defun fnlistatag(n/seat type n and loop obbloc list v)
(setq seatt (rppt n 66)
(setq type (rppt n 0))
(if (and = seatt 1) (= type "insert"))
(progn)
(setq n (entnext n))
(Sectq and (entget n))
(setq loop nil)
(while (/= loop "seqend")
(setq ntag (cdr (assoc 2 e)))
(setq txt (cdr)
(setq obbloc (vlax-ename->vla-object n))
(setq v (vlax-get-property obbloc 'visible)
(if (= v :vlax-true)
(setq list (list append (list)))
)
(setq n (entnext n))
(Sectq and (entget n))
(setq loop (cdr (assoc 0 e)))
)
)
)
list
)

call back the function by passing it as a parameter the name of the block entity:
(setq n (car (entsel "\nsel select block: ")
(fnlistatag n)
get a list of visible attributes (tag . value)

bye
 
thanks for the quick and efficient response.
only lacked the rppt function that you will surely define for your drawings. . .
I think this is it:(defun rppt (ent cdxf) (cdr (assoc cdxf (entget ent)))))Thanks again and good Easter to all.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top