autolisp code to set "explodable" propery of block "ON"

autolisp code to set "explodable" propery of block "ON"

GeryKnee
Advocate Advocate
493 Views
4 Replies
Message 1 of 5

autolisp code to set "explodable" propery of block "ON"

GeryKnee
Advocate
Advocate

Hi,

Please inform me wich is the autolisp code to set "explodable" propery of block "ON"

THanks,

Gery

0 Likes
Accepted solutions (2)
494 Views
4 Replies
Replies (4)
Message 2 of 5

Moshe-A
Mentor
Mentor
Accepted solution

@GeryKnee ,

 

Explodable property is part of AcDbBlockTableRecord object which is block definition.

 

Moshe

 

 

 

(defun c:explchk (/ pick ent elist blocks blkrec)
 (cond
  ((not
     (and
       (setq pick (entsel "\nPick block reference: "))
       (setq elist (entget (setq ent (car pick))))
       (eq (cdr (assoc '0 elist)) "INSERT")
     )
   ) 
   (prompt "\nObject selected is not block reference.")
  ); case
  ( t
   ; allocating memory
   (setq blocks (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))) 	; AcDbBlockTable
   (setq blkrec (vla-item blocks (cdr (assoc '2 elist))))				; AcDbBlockTableRecord
    
   (princ (strcat "\nExplodable property is: " (vl-princ-to-string (vla-get-explodable blkrec))))      

   ; dispose memory
   (vlax-release-object blkrec)
   (vlax-release-object blocks)
  ); case
 ); cond

 (princ)
)

 

 

 

 

 

 

Message 3 of 5

paullimapa
Mentor
Mentor
Accepted solution

Keep in mind you can always use vlax-dump-object function to review object properties that you can get or put

http://docs.autodesk.com/ACD/2011/ENU/filesALR/WS1a9193826455f5ff1a32d8d10ebc6b7ccc-682a.htm


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 4 of 5

Sea-Haven
Mentor
Mentor
;;;===================================================================; 
;;; DumpIt                                                            ; 
;;;-------------------------------------------------------------------; 
;;; Dump all methods and properties for selected objects              ; 
;;;===================================================================; 
(defun C:Dumpit ( / ent) 
  (while (setq ent (entsel)) 
    (vlax-Dump-Object 
      (vlax-Ename->Vla-Object (car ent)) 
    ) 
  ) 
  (princ) 
)

;(dumpallproperties (car (entsel)))
0 Likes
Message 5 of 5

Sea-Haven
Mentor
Mentor

Hi Gerry please dont take this the wrong way, you have posted tiny requests, mostly about methods, I know your trying to learn, it would be much better if you posted a task. We can provide say a flow chart / steps of how to solve, then you can have a go at coding, we are happy to help. The only way to learn is do real tasks.

 

So tell us about a new task you want to do.

 

0 Likes