Message 1 of 10
Help with vla and vlax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I'm new here and I have a very limited understanding of lisp.
I have a code that let me pick a block and gives back the blockname as "ebname" and an vla object "obj"
The goal is to skip this and put the blockname direct in the code
(while (not e)
(and
(setq e (car (entsel "\nSelect sample block to export: ")))
(setq edata (entget e))
(if (/= (cdr (assoc 0 edata)) "INSERT")(progn (princ " this is not a block! ")(setq e nil)))
)
)
(setq bname (cdr (assoc 2 edata))
ebname (vla-get-Effectivename (setq obj (vlax-ename->vla-object e)))
atts ""
)
(princ (strcat bname (if (= (ascii bname) 42) (strcat " (" ebname ")") ""))) ; "*" ?
If I got it right I pickup something and the first element is passed to "e". (What are the other elements?)
It checks if i got a block (assoc 0) and set bname to the blockname (assoc 2)
Now I struggle what is ebname and obj set to?
ebname is later used for a block selection:
(setq ss (ssget (list (cons 0 "INSERT")(cons 2 (strcat ebname ",`*U*")))) i 0 cnt 0)
and obj for extracting attributes
(foreach att (vlax-invoke obj 'GetAttributes)(setq atts (strcat atts __BCdelimiter "\"" (vlax-get att 'TagString) "\"")))
and now I'm in way too advanced teritorry. How can I put my blockname directly into the code?
I hope some can enlighten me
Thanks in advantage
Kai