Is possible to not explode a Dynamic Block to get informations?

Is possible to not explode a Dynamic Block to get informations?

Anonymous
Not applicable
843 Views
2 Replies
Message 1 of 3

Is possible to not explode a Dynamic Block to get informations?

Anonymous
Not applicable
I need to acess The Objects which are part ld a Dynamc Block. I would like to find the vl object names os the lines and so on without using method explode.
0 Likes
Accepted solutions (1)
844 Views
2 Replies
Replies (2)
Message 2 of 3

devitg
Advisor
Advisor

Yes . it is possible by the vla

 

(VL-LOAD-COM)
  (SETQ ACAD-OBJ (VLAX-GET-ACAD-OBJECT)) ;_ el programa ACAD 
  (SETQ ADOC (VLA-GET-ACTIVEDOCUMENT ACAD-OBJ)) ;_ el DWG que esta abierto-
  (SETQ MODEL (VLA-GET-MODELSPACE ADOC))
  (SETQ BLOCK-COLL (VLA-GET-BLOCKS ADOC))


(setq block (vla-Item BLOCK-COLL "blockname"))

Then you can dig on each its COUNT 

 

or DUMP its property's and method by 

 

(vlax-dump-Object block t)

 

 

 

 

 

Message 3 of 3

Satish_Rajdev
Advocate
Advocate
Accepted solution

Try this out :-

(defun get:objects (n / l)
  (vlax-for x (vla-get-blocks
		(vla-get-activedocument (vlax-get-acad-object))
	      )
    (if	(eq (strcase (vla-get-name x)) (strcase n))
      (vlax-for	y x
	(setq l (cons y l))
      )
    )
  )
  l
)

Add Block name to this functions like this:

(get:objects "BLOCK NAME")

Best Regards,
Satish Rajdev


REY Technologies | Linked IN | YouTube Channel