- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
This is my first post...I'am only reading usually. 🙂 And i'm beginner in lisp! 😞
I used "BAL" lips and it works perfectly!! thanks to Kent1Cooper for this awesome lisp!!!
What i wanna do is that this lisp is sorting the selected blocks by its attribute values for example "NL1/1" the next block has value "NL1/2", the next "NL1/3" and so forth... these are different blocks (and names) but they have all the same attribute tag: "STROMKREIS" with values: "NL1/1" next block "NL1/2" another block "NL1/3".....so i would have all the blocks sorted in a row... 🙂
I tried but i failed! Here's the modified code:
(defun C:BAL (/ osm bss pt rad len values blk n spc); = Block Align
;; for Blocks with primary Circle, with insertion point at its center
(setq osm (getvar 'osmode))
(prompt "\nBlöcke wählen, welche aufzulisten sind!")
(if
(and
(setq bss (ssget '((0 . "INSERT"))))
(setq pt (getpoint "\nLinken Startpunkt der Reihe angeben: "))
(setq rad 2)
(setq len 2)
); and
(progn ; then
(setvar 'osmode 0)
(setq values (cons (cadr
(assoc
"STROMKREIS"
(mapcar '(lambda (at)
(list (vla-get-tagstring at)(vla-get-textstring at)))
(vlax-invoke
(vlax-ename->vla-object (ssname blk (Setq i (1- i))))
'GetAttributes)
)
)
)
values
)
)
(repeat (setq n (sslength bss))
(command
"_.copy" (setq blk (ssname bss (setq n (1- n)))) ""
(cdr (assoc 10 (entget blk))) pt
); command
(setq pt (polar pt 0 rad))
); repeat
(setvar 'osmode osm)
); progn
); if
); defun
Do you have any ideas!? please help me!
Thank you!!!!
Solved! Go to Solution.