Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with making a block layers?

1 REPLY 1
SOLVED
Reply
Message 1 of 2
jinkinglee
253 Views, 1 Reply

Help with making a block layers?

I need help with lisp, so I can make 2 block layers. 1 is front and another is back.

 

Here is the lisp below:

 

(command "layer" "make" "Front" "color" "70" "" "ltype" "dot" "" "")
    (COMMAND "PLINE" P_29 P21 P_32 "")
  (COMMAND "LINE" B4 B5 "")

 

(command "layer" "make" "BACK" "c" "7" "" "") 

(COMMAND "LINE" P28 P27 "")
  (COMMAND "ARC" "" S3B)
  (COMMAND "ARC" "" P23)
  (COMMAND "ARC" "" P31)

 

 

 

this is autocad:

Command: '_layer
Command: block
Specify insertion base point:
Select objects: Specify opposite corner: 21 found

Select objects:

1 REPLY 1
Message 2 of 2
paullimapa
in reply to: jinkinglee

Looks like you got the lisp function working for creating the layers "Front" & "BACK".

I'm not sure what's going on with the PLINE, LINE & ARC codes.

But if you would like a sequence of lisp functions to create a Block with a base boint and create a window selection set of objects, then I would include the following:

; ask for block name

(setq blkname (getstring"\nEnter block name: "))

; ask for base point

(setq blkpt (getpoint"\nSpecify Block insertion base point"))

; ask for selection to include

(princ"\nSelect ojbects: ")

(setq blkss (ssget))

; execute block command

(command"_.Block" blkname blkpt blkss "")

; let user know of block name created

(princ (strcat"\nBlock name " blkname " creation completed."))(princ)

; execute oops command to bring selection back

(command"_.Oops")


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost