Jump to content

Recommended Posts

Posted

I am beating my head on the wall...

 

I have written simple lisps to help with my day to day Cad work.

 

Here is my problem, I am trying to write a routine that creates a group of layers using a common variable.

 

Example:

Variable= Lot-01

Resulting layers;

Lot-Boundary-Lot-01

Lot-Annot-Perimiter-Lot-01

Lot-Annot-Name-Area-Lot-1

Lot-Set-Backs-Lot-1

Lot-Annot-Tie-Lot-1

 

It would also set the color and linetype for the layer.

 

Thanks for the help

Posted

A simple way could do lots of smarter things

 

(setq ans (getstring "\nEnter variable :"))
(setq newans (strcat "Lot-Boundary-" ans))
(command "la" "N" newans "C" 1 "")

repeat last 2 lines as required

Posted

Thank you.

 

My problem was getting the variable usage correct.

Posted

For more flexibility you may modify the code BIGAL provided to you to parse a list of prefixes:

 

(foreach newans '("Lot-Boundary-" "Lot-Annot-Perim[color=red]i[/color]ter-" "Lot-Annot-Name-Area-" "Lot-Set-Backs-" "Lot-Annot-Tie-")
(setq newans (strcat newans ans))
(command "la" "N" newans "C" 1 "")
)

 

Regards,

Mircea

Posted

Thanks for the help everybody.

 

This was the first time I have used user input in a lisp. I was close but not getting the useage correct.

It creates the needed layers quickly and correctly. I also added a line that copies a base layout and names it as the user input.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...