Author Topic: Checking if linetype is loaded..  (Read 3047 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Checking if linetype is loaded..
« on: April 18, 2006, 08:24:00 AM »
Hi all..

I'm trying to know if its possible to get this working..

Code: [Select]
(member "continuous" GEN_LIST_ltype)
Without using filtering the list and compare the letter CaSe.
Because is not....(case sensitive)

thanks.

« Last Edit: April 18, 2006, 10:29:38 AM by Andrea »
Keep smile...

Sdoman

  • Guest
Re: (if (member ....
« Reply #1 on: April 18, 2006, 08:33:20 AM »
Hi - I'm not sure what your question is, but does this help?

Code: [Select]
(member "CONTINUOUS" (mapcar 'strcase GEN_LIST_ltype))

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (if (member ....
« Reply #2 on: April 18, 2006, 08:41:14 AM »
What is  GEN_LIST_ltype ?

Please confirm if you do or do not test cases ?

If you want the list lower case, perhaps something like :

Code: [Select]
  (MEMBER   ... or .... (vl-position "continuous" (MAPCAR '(LAMBDA (x) (STRCASE x T)) GEN_LIST_ltype) )
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: (if (member ....
« Reply #3 on: April 18, 2006, 08:56:42 AM »
Exactly what i need..
thanks guys..

By the way...
Is there any solution to know if a linetype is loaded and load if not ?

example....if iI use
Code: [Select]
(command "_-LINETYPE" "_LOAD" "hidden" "ACAD.LIN")maybe its work...but don't know realy if Hidden is part of ACAD.LIN or ACADISO.LIN..

simple maybe.... :|
Keep smile...

JohnK

  • Administrator
  • Seagull
  • Posts: 10638
Re: (if (member ....
« Reply #4 on: April 18, 2006, 09:08:02 AM »
Andrea, I know you got your questions answered but im thinking of those who might have the same problem in the future; can the title of your thread be re-done? Its a bit confusing.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: (if (member ....
« Reply #5 on: April 18, 2006, 09:14:12 AM »
Exactly what i need..
example....if iI use
Code: [Select]
(command "_-LINETYPE" "_LOAD" "hidden" "ACAD.LIN")maybe its work...but don't know realy if Hidden is part of ACAD.LIN or ACADISO.LIN..

simple maybe.... :|



Have you looked ? ?




It's in both.


Use the "MEASUREMENT" Sysvar to determine which file to load.
Determining if it's loaded is as simple as checking the LineTyle Table.


See
;;; (ai_table <table name> <bit> )

in the AI_UTILS.LSP file.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: (if (member ....
« Reply #6 on: April 18, 2006, 09:20:19 AM »
Kerry..
I know that...

But the problem is that some client use diffrent filename..
so is there anyway to know where the specific linetype come from ?

se7en..
thanks....but my english is poor..
could you submit suggestion ?.
Keep smile...

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: how to loading linetype..
« Reply #7 on: April 18, 2006, 09:37:02 AM »
That wasn't the question you asked !

I'm not a mind reader.

If clients use different linetype files it would be up to them to make sure it is loaded.

If you just test for "HIDDEN", if it's not in the drawing load either of the standard files dependant on the "MEASUREMENT" System variable.  If you load a file, prompt a message to the command line to advise the client, or it necessary throw up a dialog alert telling him you are loading it. He can always redefine it later if necessary. { Just make sure you document the requirement so they KNOW }

I f the client wants different, let him tell you what he wants.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

JohnK

  • Administrator
  • Seagull
  • Posts: 10638
Re: how to loading linetype..
« Reply #8 on: April 18, 2006, 10:12:14 AM »
Andrea, i would say soemthing like "Checking if linetype is loaded".


TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Andrea

  • Water Moccasin
  • Posts: 2372
Re: how to loading linetype..
« Reply #9 on: April 18, 2006, 10:29:12 AM »
thanks Kerry..

but the MEASUREMENT variable is useful only to know if its ISO file or not. (METRIC or IMPERIAL)
is not exactly wath i'm trying to do..

Is not important in this case wich file is loaded...
what i'm looking for is, to search wich linetype is comming from..

eg:

linetype name = Fencetype1
found in Architect1.lin file

we have all LIN file in same folder here...
but I dont want to load all linetype from each file for only for 1.

maybe my english is not clear...but trying to do my best.. sorry.. :|
Keep smile...

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Checking if linetype is loaded..
« Reply #10 on: April 18, 2006, 10:36:03 AM »
Perhaps,

Make a textfile index of the Linetyles with their associated fileName

similar to
(
( ("lt1" "lt2" "lt3".... ) "FileName1")
( ("lt11" "lt12" "lt13".... ) "FileName2")
)

then parse the index and extract the FileName.


...... OR Read and parse the .LIN files directly, till you find the Linetype ..
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Checking if linetype is loaded..
« Reply #11 on: April 18, 2006, 11:40:07 AM »
Thanks Kerry...

That what i tought..

But I have noted something..
if I make a line and than..change the linetype of it...
and use one of ACAD.lin or ACADISO.lin..
I don't need to load it before..

So maybe there is a variable or setting to do to add other LIN file..
Keep smile...