Accessing MVBlock style definition in LISP

Accessing MVBlock style definition in LISP

Kevin.Bell
Advisor Advisor
812 Views
4 Replies
Message 1 of 5

Accessing MVBlock style definition in LISP

Kevin.Bell
Advisor
Advisor
Hi,

I'm trying to write a lisp routine which would return the view blocks using in a multi-view block definition.

This would allow the user to click on the MVBlock and edit its plan view block for instance.

Anyone know where I can access the definition for a MVBLOCK in lisp? I tried TBLSEARCH - but no joy there.

Cheers.
0 Likes
813 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
There is a cool german lisp program called MVBEdit.lsp
run it and select a MVB and it will open the block you are looking at (i.e.
plan view, model or side view) allowing you to edit it.
I've tried to englishify it but it fails??? But here's the original

wrote in message news:[email protected]...
Hi,

I'm trying to write a lisp routine which would return the view blocks using
in a multi-view block definition.

This would allow the user to click on the MVBlock and edit its plan view
block for instance.

Anyone know where I can access the definition for a MVBLOCK in lisp? I tried
TBLSEARCH - but no joy there.

Cheers.
0 Likes
Message 3 of 5

Kevin.Bell
Advisor
Advisor
I can't get that LISP to run - I get an malformed list error (Does it work your end??)

Though looking at how it work, it copies the MVBlock you select, then explodes it twice and then queries what's left to gain the name of the block.

It then ref edits that.

It then seems to set up a reactor to catch the end of ref edit to complete the lisp programme...

Thats a very strange way of doing things, but it seems to work (on paper that is) - I'll try to fill in the missing bits to get it working.

Cheers. Edited by: archie776 on Mar 24, 2010 12:42 PM
0 Likes
Message 4 of 5

Kevin.Bell
Advisor
Advisor
I wrote a simple LISP which does the same thing (or at least I think it does as I haven't managed to get your LISP working).

It copies the MVBLOCK, explodes it twice, gets the block name, erases the copied block and then runs BEDIT on it.



(defun C:MVBED ( / mvbed:blocktoedit mvbed:blockname)

(setq
mvbed:blocktoedit
(car
(entsel
"\nSelect MBVBlock to edit current display block;"
)
)
)

(command "copy" mvbed:blocktoedit "" "0,0,0" "0,0,0")

(command "explode" "l")

(command "explode" "l")

(setq mvbed:blockname (cdr (assoc 2 (entget (ssname (ssget "l") 0)))))
(command "erase" "l" "")

(command "bedit" mvbed:blockname)
(princ "\nEditting block ")
(princ mvbed:blockname)
(princ)
)
0 Likes
Message 5 of 5

Anonymous
Not applicable
I might have posted my munched copy.
I tried to put proper line returns back in and change the german? to english
but it likes neither.
However the original does run for me.
I have attached it here without any of my amateur interference.
This one works in ACA09 and did in ADT06
But if you have yours working......

wrote in message news:[email protected]...
I wrote a simple LISP which does the same thing (or at least I think it does
as I haven't managed to get your LISP working).

It copies the MVBLOCK, explodes it twice, gets the block name, erases the
copied block and then runs BEDIT on it.



(defun C:MVBED ( / mvbed:blocktoedit mvbed:blockname)

(setq
mvbed:blocktoedit
(car
(entsel
"\nSelect MBVBlock to edit current display block;"
)
)
)

(command "copy" mvbed:blocktoedit "" "0,0,0" "0,0,0")

(command "explode" "l")

(command "explode" "l")

(setq mvbed:blockname (cdr (assoc 2 (entget (ssname (ssget "l") 0)))))
(command "erase" "l" "")

(command "bedit" mvbed:blockname)
(princ "\nEditting block ")
(princ mvbed:blockname)
(princ)
)
0 Likes