Hatch pattern list

Discussion in 'AutoCAD' started by Marco Jacinto, Jan 5, 2004.

  1. Hi everybody,

    I'm trying to find a list of all the paterns in the system.

    There is an easy way, or should I search throw the files
    to find the names?

    Thanks.

    Saludos

    Marco Jacinto
     
    Marco Jacinto, Jan 5, 2004
    #1
  2. Marco Jacinto

    Rudy Tovar Guest

    ACAD.PAT?
    Example *NAME

    *SOLID, Solid fill
    45, 0,0, 0,.125

    There may be some vla function someones comeup with.
    --

    AUTODESK
    Authorized Developer
    www.Cadentity.com
    MASi
     
    Rudy Tovar, Jan 6, 2004
    #2
  3. aqui tienes un ejemplo de como, espero te sirva:

    ;; archivos pat dentro del directorio de soporte de autocad 2004
    (vl-directory-files
    (vl-filename-directory (findfile "acad.pat"))
    "*.pat")

    ;;;("acad.pat"
    ;;; "acadiso.pat" "ashlar.pat" "hillstone.pat"
    ;;; "ledgestone.pat" "riverrock.pat" "rubble.pat")

    ;; leer el archivo "acad.pat"
    (setq file_open (open (findfile "acad.pat") "r"))

    ;; lectura linea por linea, mientras no llegemos al final de archivo
    (while (setq line (read-line file_open))
    ;; guardar lineas en un listado
    (setq tmp (cons line tmp)))

    ;; cerrar el archivo
    (close file_open)

    ;; colocar la lista de principio a fin
    (setq tmp (reverse tmp))

    ;; hacer un listado solo de donde encontremos el aterisco
    ;; estara siempre en el primer caracter
    (setq lst (vl-remove-if-not
    '(lambda (string)
    (if (eq (substr string 1 1) "*")
    string))
    tmp))

    ;; hacer un listado de los nombres de los pat's
    (setq
    lst_2 (mapcar
    '(lambda (string)
    (substr string 2 (- (vl-string-search "," string) 1)))
    lst))

    saludos,
    luis
     
    Luis Esquivel, Jan 6, 2004
    #3
  4. Hi Marco,

    Not sure if this is what you are after exactly but this will give you what
    is in the acad.pat file... at the command line try this.

    Command: hatch

    Enter a pattern name or [?/Solid/User defined] <ANSI31>: ?

    Enter pattern(s) to list <*>:

    SOLID - Solid fill
    ANGLE - Angle steel
    ANSI31 - ANSI Iron, Brick, Stone masonry
    etc...

    It is a start, gives you the name and the description, does not include any
    custom files though. Then you can highlight and copy from the text screen.
    Hope this helps.

    Arnold Williams
    Architectural Designer/CAD Coordinator
    SCM Consultants, Inc.
     
    Arnold Williams, Jan 6, 2004
    #4
  5. Thanks to everybody,

    Actually I have a routine to get the names from the acad pat, and to list
    them
    to further work with it, something similar to that from Luis, but in plain
    Lisp,
    I just wanted to know if there where another method, thanks again.

    Saludos

    Marco Jacinto
     
    Marco Jacinto, Jan 6, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.