Like this, but i does not work
Code:(setq EntName (tblobjname "BLOCK" "MyTemporaryBlock" ) ) (entdel EntName )
: ) Happy Computing !
kennet
|
Like this, but i does not work
Code:(setq EntName (tblobjname "BLOCK" "MyTemporaryBlock" ) ) (entdel EntName )
: ) Happy Computing !
kennet
Maybe make sure that there is no inserts of the block name, and then try to delete it from the block collection. It maybe nested though.
Code:(defun DeleteBlockDef (BlkName) (if (ssget "x" (list (cons 2 BlkName))) (prompt "\n There are still inserts of this block.") (if (vl-catch-all-error-p (vl-catch-all-apply '(lambda () (vla-Delete (vla-Item (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-Acad-Object) ) ) BlkName ) ) ) ) ) (prompt "\n Block definition could not be deleted.") (prompt "\n Block definition was deleted.") ) ) (princ) )
No, there is no inserts or nested block, just a blockdefinition, so the . . .
. . .did the trick.Code:(vla-Delete (vla-Item (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-Acad-Object )) ) BlkName ))
Thank you very much Tim and
: ) Happy Computing !
kennet
BTW
I have problem with the (vla-get-WhatCanISelectHere
for example UCS or equals, is there any information in the help document to find it ?
: ) Happy Computing !
kennet
It depends of the object, you can try to dump the object to see all the properties that you can (vla-get)
(vlax-dump-object object T)
You're welcome Kennet. As intergrupocr mentioned, you can do that per object you have. You can look through the help files also, that is where I learned most of the ActiveX controls. Once you're in the help files, get to the Developers Guide. Then you will want to look at the ActiveX and VBA Reference. In there you will have a couple other book type things to select from. If you select the object one, then you will get a list of all the objects, and then when you select on one of them, it will go specific to that one object, and it will show all the properties/methods/events for that object. The only problem is getting the right syntax in lisp. One example is
(vlax-invoke BlkObj 'GetAttributes)
Will return a list of all the blocks attributes as objects
(vla-GetAttributres BlkObj)
Will return a variant of all the blocks attributes as objects. These come with experience.
Tank you Tim and intergrupocr, this is still a jungle for me and I have to play a lot more to have the experience.Originally Posted by T.Willey
: ) Happy Computing !
kennet