×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Quick Block

Quick Block

Quick Block

(OP)
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

RE: Quick Block

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!

RE: Quick Block

(OP)
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
)

RE: Quick Block

Glad I could point you towards self-sufficiency!
LISP can be easy!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources