Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick Block

Status
Not open for further replies.

tzinger

Aerospace
Joined
Dec 16, 2002
Messages
42
Location
US
Has anybody used/created a lisp routine that will allow you to select the objects... then auotmatically, change properties to layer 0, color Bylayer, ltype bylayer and then convert to a block using typed name or anonymus name remove object and insert in same location?

This sounds like a LISP routine, but I am not savy enough to write lisp files...or maybe one already exists that i can manipulate.

Any help would be cool

tzinger

 
You can do it!
Here is a very crude beginning.
It may not work right away but you get the idea, I'm sure.

(Defun C:MakeMeABlock (/pset)
(setq pset (ssget)) ; Select objects
(command "chprop" "p" "" "la" "0") ; Change layer
(command "chprop" "p" "" "co" "bylayer") ; Change color
(command "chprop" "p" "" "lt" "bylayer") ; Change linetype
(command "block" pause pause "p" "") ; Make a block
(command "insert" pause "@0,0" "1" "1" "0") ; Insert a block
)

It is not elegant, but it is quick!
 
Thanks --- IFRs (Petroleum)

That was a great start, I was able to tweak it enough to get it to work the way I wanted it to. Here it is after tweak...

(Defun C:qb ()
(setq p (ssget)) ; Select objects
(command "chprop" "p" "" "la" "0" "") ; Change layer
(command "chprop" "p" "" "c" "bylayer" "") ; Change color
(command "chprop" "p" "" "lt" "bylayer" "") ; Change linetype
(command "copybase" "0,0,0" "p" "") ; Copy Items to Clip Board
(command "erase" "p" "") ; Delete original objects
(command "pasteblock" "0,0,0") ; Paste as Block in place of original objects
)
 
Glad I could point you towards self-sufficiency!
LISP can be easy!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top