Author Topic: validate layer names?  (Read 2046 times)

0 Members and 1 Guest are viewing this topic.

mkweaver

  • Bull Frog
  • Posts: 352
validate layer names?
« on: January 27, 2009, 08:58:17 AM »
Isn't there a lisp function that will check a layer/block name for validity?  I've searched help, here on the swamp, and the autodesk newsgroups, but haven't found what I'm looking for.  Have I missed something?

Pointers appreciated.

Mike

lispman21

  • Guest
Re: validate layer names?
« Reply #1 on: January 27, 2009, 08:59:57 AM »
Maybe something like this

Code: [Select]
      (if (tblsearch "layer" "layername")
(command "-layer" "s" "layername")
(command "-layer" "m" "layername" "c" "red" "layername" "")
      );;end of if

mkweaver

  • Bull Frog
  • Posts: 352
Re: validate layer names?
« Reply #2 on: January 27, 2009, 09:11:26 AM »
I'm not checking to see if the layer exists, I want to know if the layer name is valid - will I get an error if I try to create a layer with this name?

Thanks

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: validate layer names?
« Reply #3 on: January 27, 2009, 09:17:31 AM »
(snvalid sym_name [flag])

Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

mkweaver

  • Bull Frog
  • Posts: 352
Re: validate layer names?
« Reply #4 on: January 27, 2009, 10:14:59 AM »
(snvalid sym_name [flag])



Thats what I was looking for!

Thank you much!

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: validate layer names?
« Reply #5 on: January 27, 2009, 11:14:35 AM »
You're most welcome Mike.

Code: [Select]
(defun IsBliss ( question gratitude )
    (and
        (IsEasy question)
        (IsGreat gratitude)
    )
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

adalea03

  • Guest
Re: validate layer names?
« Reply #6 on: January 31, 2009, 08:31:51 AM »
Quote
(defun IsBliss ( question gratitude )
    (and
        (IsEasy question)
        (IsGreat gratitude)
    )
)

While I envy your mastery, coding seems to have become more than a second language, heh MP?

Tony

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: validate layer names?
« Reply #7 on: January 31, 2009, 09:08:13 AM »
T
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst