Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Please inform me wich is the autolisp code to set "explodable" propery of block "ON"
THanks,
Gery
Solved! Go to Solution.
Hi,
Please inform me wich is the autolisp code to set "explodable" propery of block "ON"
THanks,
Gery
Solved! Go to Solution.
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)
)
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
;;;===================================================================;
;;; 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)))
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.