Jump to content

Lisp Make Layers. Lineweight 0.0 instead of "Default"


Sittingbull

Recommended Posts

Hi all,

 

 

I'm using Mac Lee's Makalayer routine to create layers with lisp.

 

(defun MakeLayer ( name colour linetype lineweight willplot bitflag description )
 ;; © Lee Mac 2010
 (or (tblsearch "LAYER" name)
   (entmake
     (append
       (list
         (cons 0 "LAYER")
         (cons 100 "AcDbSymbolTableRecord")
         (cons 100 "AcDbLayerTableRecord")
         (cons 2  name)
         (cons 70 bitflag)
         (cons 290 (if willplot 1 0))
         (cons 6
           (if (and linetype (tblsearch "LTYPE" linetype))
             linetype "CONTINUOUS"
           )
         )
         (cons 62 (if (and colour (< 0 (abs colour) 256)) colour 7))
         (cons 370
           (fix
             (* 100
               (if (and lineweight (<= 0.0 lineweight 2.11)) lineweight 0.0)
             )
           )
         )
       )
       (if description
         (list
           (list -3
             (list "AcAecLayerStandard" (cons 1000 "") (cons 1000 description))
           )
         )
       )
     )
   )
 )
)
(defun c:norlays nil (vl-load-com)
 ;; © Lee Mac 2010
 ;; Specifications:
 ;; Description        Data Type        Remarks
 ;; -----------------------------------------------------------------
 ;; Layer Name          STRING          Only standard chars allowed
 ;; Layer Colour        INTEGER         may be nil, -ve for Layer Off, Colour < 256
 ;; Layer Linetype      STRING          may be nil, If not loaded, CONTINUOUS.
 ;; Layer Lineweight    REAL            may be nil, 0 <= x <= 2.11
 ;; Plot?               BOOLEAN         T = Plot Layer, nil otherwise
 ;; Bit Flag            INTEGER         0=None, 1=Frozen, 2=Frozen in VP, 4=Locked
 ;; Description         STRING          may be nil for no description
 ;; Function will return list detailing whether layer creation is successful.    
 (
   (lambda ( lst / lts ) (setq lts (vla-get-Linetypes (vla-get-ActiveDocument (vlax-get-acad-object))))
     (mapcar 'cons (mapcar 'car lst)
       (mapcar
         (function
           (lambda ( x )
             (and (caddr x)
               (or (tblsearch "LTYPE" (caddr x))
                 (vl-catch-all-apply 'vla-load (list lts (caddr x) "acad.lin"))
               )
             )
             (apply 'MakeLayer x)
           )
         )
         lst
       )
     )
   )
  '(
   ;  Name    Colour   Linetype Lineweight Plot? Bitflag      Description 
   ( "EL_COMPONENTS"   7  "CONTINUOUS" Default  T 0  nil  )
   ( "EL_CONSTR_COMP"  1  "CONTINUOUS" Default  T 0  nil  )
   ( "EL_FITTINGS"   4  "CONTINUOUS" Default  T 0  nil  )
   ( "EL_LABEL"   1  "CONTINUOUS" Default  T 0  nil  )
   ( "EL_LABEL_TXT"   252  "CONTINUOUS" Default  T 0  nil  )
   ( "EL_TERMINALS"   1  "CONTINUOUS" Default  T 0  nil  )
   ( "EL_TERMINALS_PE"  24  "CONTINUOUS" Default  T 0  nil  )
   ( "EL_TERMINALS_TXT"  252  "CONTINUOUS" Default  T 0  nil  )
   ( "EL_TXT"   252  "CONTINUOUS" Default  T 0  nil  )
   ( "EL_WIRES"   252  "CONTINUOUS" Default  T 0  nil  )
   ( "GE_ANNOTATION"   7  "CONTINUOUS" Default  T 0  nil  )
   ( "GE_LABEL"   10  "CONTINUOUS" Default  T 0  nil  )
   ( "GE_LABEL_TEXT"   253  "CONTINUOUS" Default  T 0  nil  )
   ( "GE_TXT_LANGUAGE_DU"  252  "CONTINUOUS" Default  T 0  nil  )
   ( "GE_TXT_LANGUAGE_EN"  252  "CONTINUOUS" Default        T 0  nil  )
   ( "GE_TXT_LANGUAGE_FR"  252  "CONTINUOUS" Default        T 0  nil  )
   ( "GE_TXT_LANGUAGE_GE"  252  "CONTINUOUS" Default        T 0  nil  )
   ( "LA_HEADER_FRAME"  7  "CONTINUOUS" Default        T 0  nil  )
   ( "LA_HEADER_TXT"   7  "CONTINUOUS" Default        T 0  nil  )
   ( "LA_MATLIST"   254  "CONTINUOUS" Default        T 0  nil  )
   ( "LA_MATLIST_FRAME"  254  "CONTINUOUS" Default        T 0  nil  )
   ( "LA_MATLIST_POS"  254  "CONTINUOUS" Default        T 0  nil  )
   ( "LA_MATLIST_TXT"  252  "CONTINUOUS" Default        T 0  nil  )
   ( "LA_TITLE_FRAME"  7  "CONTINUOUS" Default        T 0  nil  )
   ( "LA_TITLE_LOGO"   10  "CONTINUOUS" Default        T 0  nil  )
   ( "LA_TITLE_LOGO_TXT"  7  "CONTINUOUS" Default        T 0  nil  )
   ( "LA_TITLE_TXT"   7  "CONTINUOUS" Default        T 0  nil  )
   ( "LA_VIEWPORTS"   230  "CONTINUOUS" Default        nil 0  nil  )
   ( "PN_ACCESSORIES"  30  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_ACTUATORS"   160  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_AIR_LINE_EQUIPMENT"  40  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_BRACKET_MOUNTING"  1  "ACAD_ISO12W100"Default        T 0  nil  )
   ( "PN_CABINET"   8  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_CABINET_DIM"  8  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_COMPONENTS"   7  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_CONDUCTS"   3  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_CONSTR_COMP"  2  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_DRAIN"   3  "HIDDEN" Default        T 0  nil  )
   ( "PN_EXHAUST"   104  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_FITTINGS"   30  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_IDENTIFICATION"  4  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_PILOT_SUPPLY"  3  "HIDDEN" Default        T 0  nil  )
   ( "PN_PORT_NUMBERS"  8  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_PRESSURE_SWITCHES"  200  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_PROPORTIONAL_VALVES" 226  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_SECTIONS"   3  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_SUB-BASES"   8  "ACAD_ISO12W100"Default        T 0  nil  )
   ( "PN_SUB-BASE_CONDUCTS"  2  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_SUPPLY"   3  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_TXT"   3  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_VACUUM"   60  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_VALVES"   240  "CONTINUOUS" Default        T 0  nil  )
   ( "PN_VALVES_OVERRIDE"  1  "CONTINUOUS" Default        T 0  nil  )
   )
 )
)

 

When running the program i'm getting following error:

Command: (load "nor_layers")

C:NORLAYS

Command: norlays

; error: bad argument type for compare: 0.0 DEFAULT

Command:

 

When using "nil" instead of "Default" for the lineweight, i get "0.0" lines.

Are these the same as "Default" or is there another parameter to use to get "Default" lineweights?

 

 

thx

Link to comment
Share on other sites

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    8

  • Sittingbull

    8

  • stevesfr

    2

  • rhino

    2

It's okay :oops:. Found it.

 

Default Lineweight

 

Sets the current default lineweight. Lineweight values consist of fixed settings, including BYLAYER, BYBLOCK, and DEFAULT. Values are calculated in either inches or millimeters; millimeters are the default. If you enter a valid lineweight value, the current default lineweight is set to the new value. If you enter any other value, the default is set to the nearest valid value.

To plot an object with a lineweight that is not found in the list of fixed lineweight values, you can use the Plot Style Table Editor to customize plotted lineweights. See Control Plotted Lineweight and Linetype in the User's Guide. The DEFAULT value is set by the LWDEFAULT system variable and has an initial value of 0.01 inches or 0.25 mm. The lineweight value of 0 plots at the thinnest lineweight available on the specified plotting device and is displayed at a value of one pixel in model space.

Link to comment
Share on other sites

Hi SittingBull,

 

I have updated the code, please read the specifications panel regarding lineweight:

 

(defun MakeLayer ( name colour linetype lineweight willplot bitflag description )
 ;; © Lee Mac 2010
 (or (tblsearch "LAYER" name)
   (entmake
     (append
       (list
         (cons 0 "LAYER")
         (cons 100 "AcDbSymbolTableRecord")
         (cons 100 "AcDbLayerTableRecord")
         (cons 2  name)
         (cons 70 bitflag)
         (cons 290 (if willplot 1 0))
         (cons 6
           (if (and linetype (tblsearch "LTYPE" linetype))
             linetype "CONTINUOUS"
           )
         )
         (cons 62 (if (and colour (< 0 (abs colour) 256)) colour 7))
         (cons 370
           (if (minusp lineweight) -3
             (fix
               (* 100
                 (if (and lineweight (<= 0.0 lineweight 2.11)) lineweight 0.0)
               )
             )
           )
         )
       )
       (if description
         (list
           (list -3
             (list "AcAecLayerStandard" (cons 1000 "") (cons 1000 description))
           )
         )
       )
     )
   )
 )
)


(defun c:norlays nil (vl-load-com)
 
 ;; © Lee Mac 2010
 ;; Specifications:
 ;; Description        Data Type        Remarks
 ;; -----------------------------------------------------------------
 ;; Layer Name          STRING          Only standard chars allowed
 ;; Layer Colour        INTEGER         may be nil, -ve for Layer Off, Colour < 256
 ;; Layer Linetype      STRING          may be nil, If not loaded, CONTINUOUS.
 ;; Layer Lineweight    REAL            may be nil, negative=Default, otherwise 0 <= x <= 2.11
 ;; Plot?               BOOLEAN         T = Plot Layer, nil otherwise
 ;; Bit Flag            INTEGER         0=None, 1=Frozen, 2=Frozen in VP, 4=Locked
 ;; Description         STRING          may be nil for no description
 ;; Function will return list detailing whether layer creation is successful.    
 (
   (lambda ( lst / lts ) (setq lts (vla-get-Linetypes (vla-get-ActiveDocument (vlax-get-acad-object))))
     (mapcar 'cons (mapcar 'car lst)
       (mapcar
         (function
           (lambda ( x )
             (and (caddr x)
               (or (tblsearch "LTYPE" (caddr x))
                 (vl-catch-all-apply 'vla-load (list lts (caddr x) "acad.lin"))
               )
             )
             (apply 'MakeLayer x)
           )
         )
         lst
       )
     )
   )
  '(
   ;  Name                 Colour   Linetype    Lineweight Plot? Bitflag  Description 
   ( "EL_COMPONENTS"            7  "CONTINUOUS"     -3       T      0      nil  )
   ( "EL_CONSTR_COMP"           1  "CONTINUOUS"     -3       T      0      nil  )
   ( "EL_FITTINGS"              4  "CONTINUOUS"     -3       T      0      nil  )
   ( "EL_LABEL"                 1  "CONTINUOUS"     -3       T      0      nil  )
   ( "EL_LABEL_TXT"           252  "CONTINUOUS"     -3       T      0      nil  )
   ( "EL_TERMINALS"             1  "CONTINUOUS"     -3       T      0      nil  )
   ( "EL_TERMINALS_PE"         24  "CONTINUOUS"     -3       T      0      nil  )
   ( "EL_TERMINALS_TXT"       252  "CONTINUOUS"     -3       T      0      nil  )
   ( "EL_TXT"                 252  "CONTINUOUS"     -3       T      0      nil  )
   ( "EL_WIRES"               252  "CONTINUOUS"     -3       T      0      nil  )
   ( "GE_ANNOTATION"            7  "CONTINUOUS"     -3       T      0      nil  )
   ( "GE_LABEL"                10  "CONTINUOUS"     -3       T      0      nil  )
   ( "GE_LABEL_TEXT"          253  "CONTINUOUS"     -3       T      0      nil  )
   ( "GE_TXT_LANGUAGE_DU"     252  "CONTINUOUS"     -3       T      0      nil  )
   ( "GE_TXT_LANGUAGE_EN"     252  "CONTINUOUS"     -3       T      0      nil  )
   ( "GE_TXT_LANGUAGE_FR"     252  "CONTINUOUS"     -3       T      0      nil  )
   ( "GE_TXT_LANGUAGE_GE"     252  "CONTINUOUS"     -3       T      0      nil  )
   ( "LA_HEADER_FRAME"          7  "CONTINUOUS"     -3       T      0      nil  )
   ( "LA_HEADER_TXT"            7  "CONTINUOUS"     -3       T      0      nil  )
   ( "LA_MATLIST"             254  "CONTINUOUS"     -3       T      0      nil  )
   ( "LA_MATLIST_FRAME"       254  "CONTINUOUS"     -3       T      0      nil  )
   ( "LA_MATLIST_POS"         254  "CONTINUOUS"     -3       T      0      nil  )
   ( "LA_MATLIST_TXT"         252  "CONTINUOUS"     -3       T      0      nil  )
   ( "LA_TITLE_FRAME"           7  "CONTINUOUS"     -3       T      0      nil  )
   ( "LA_TITLE_LOGO"           10  "CONTINUOUS"     -3       T      0      nil  )
   ( "LA_TITLE_LOGO_TXT"        7  "CONTINUOUS"     -3       T      0      nil  )
   ( "LA_TITLE_TXT"             7  "CONTINUOUS"     -3       T      0      nil  )
   ( "LA_VIEWPORTS"           230  "CONTINUOUS"     -3      nil     0      nil  )
   ( "PN_ACCESSORIES"          30  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_ACTUATORS"           160  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_AIR_LINE_EQUIPMENT"   40  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_BRACKET_MOUNTING"      1  "ACAD_ISO12W100" -3       T      0      nil  )
   ( "PN_CABINET"               8  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_CABINET_DIM"           8  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_COMPONENTS"            7  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_CONDUCTS"              3  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_CONSTR_COMP"           2  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_DRAIN"                 3  "HIDDEN"         -3       T      0      nil  )
   ( "PN_EXHAUST"             104  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_FITTINGS"             30  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_IDENTIFICATION"        4  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_PILOT_SUPPLY"          3  "HIDDEN"         -3       T      0      nil  )
   ( "PN_PORT_NUMBERS"          8  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_PRESSURE_SWITCHES"   200  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_PROPORTIONAL_VALVES" 226  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_SECTIONS"              3  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_SUB-BASES"             8  "ACAD_ISO12W100" -3       T      0      nil  )
   ( "PN_SUB-BASE_CONDUCTS"     2  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_SUPPLY"                3  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_TXT"                   3  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_VACUUM"               60  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_VALVES"              240  "CONTINUOUS"     -3       T      0      nil  )
   ( "PN_VALVES_OVERRIDE"       1  "CONTINUOUS"     -3       T      0      nil  )
   )
 )
)

Link to comment
Share on other sites

this would work too:

 

(setq lay_tbl  (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))))
 (vlax-for n lay_tbl  (vla-put-LineWeight n 0))

 

for loading the linetypes:

 

;Line Load Module
(defun ln_load (/ linelist lin)
 (setq linelist '(("Center" . "acadiso.lin")
                  [code]

("Hidden" . "acadiso.lin"))

)

(foreach lin linelist

(or (tblsearch "LTYPE" (car lin))

(command "._-linetype" "_Load" (car lin) (cdr lin) "")

)

)

(princ)

); end ln_load function[/code]

Link to comment
Share on other sites

  • 2 weeks later...

Hi all,

 

The code worked fine untill i started using layers starting with ISO.

Dunno why, but when running the lisp on some files, it only creates the linetypes and not the layers.

Iff i make just one layer, average name, doen't matter, the lisp works again.

I've added a file wich is a copy of the acadiso.dwt template.

 

Here's the code with the layers i use:

 

 

(defun MakeLayer ( name colour linetype lineweight willplot bitflag description )
 ;; © Lee Mac 2010
 (or (tblsearch "LAYER" name)
   (entmake
     (append
       (list
         (cons 0 "LAYER")
         (cons 100 "AcDbSymbolTableRecord")
         (cons 100 "AcDbLayerTableRecord")
         (cons 2  name)
         (cons 70 bitflag)
         (cons 290 (if willplot 1 0))
         (cons 6
           (if (and linetype (tblsearch "LTYPE" linetype))
             linetype "CONTINUOUS"
           )
         )
         (cons 62 (if (and colour (< 0 (abs colour) 256)) colour 7))
         (cons 370
           (if (minusp lineweight) -3
             (fix
               (* 100
                 (if (and lineweight (<= 0.0 lineweight 2.11)) lineweight 0.0)
               )
             )
           )
         )
       )
       (if description
         (list
           (list -3
             (list "AcAecLayerStandard" (cons 1000 "") (cons 1000 description))
           )
         )
       )
     )
   )
 )
)

(defun c:isolays nil (vl-load-com)

 ;; © Lee Mac 2010
 ;; Specifications:
 ;; Description        Data Type        Remarks
 ;; -----------------------------------------------------------------
 ;; Layer Name          STRING          Only standard chars allowed
 ;; Layer Colour        INTEGER         may be nil, -ve for Layer Off, Colour < 256
 ;; Layer Linetype      STRING          may be nil, If not loaded, CONTINUOUS.
 ;; Layer Lineweight    REAL            may be nil, negative=Default, otherwise 0 <= x <= 2.11
 ;; Plot?               BOOLEAN         T = Plot Layer, nil otherwise
 ;; Bit Flag            INTEGER         0=None, 1=Frozen, 2=Frozen in VP, 4=Locked
 ;; Description         STRING          may be nil for no description
 ;; Function will return list detailing whether layer creation is successful.    
 (
   (lambda ( lst / lts ) (setq lts (vla-get-Linetypes (vla-get-ActiveDocument (vlax-get-acad-object))))
     (mapcar 'cons (mapcar 'car lst)
       (mapcar
         (function
           (lambda ( x )
             (and (caddr x)
               (or (tblsearch "LTYPE" (caddr x))
                 (vl-catch-all-apply 'vla-load (list lts (caddr x) "acad.lin"))
               )
             )
             (apply 'MakeLayer x)
           )
         )
         lst
       )
     )
   )
  '(
   ;  Name                  Colour   Linetype    Lineweight Plot?  Bitflag   Description 
   ( "ISO_LIN_UNI"       50  "CONTINUOUS"     0.20     T      0      "UNIversal line for a symbol"               )
   ( "ISO_LIN_FLU"       70  "CONTINUOUS"     0.20     T      0      "Elements through which a FLUid flows"      )
   ( "ISO_LIN_HAT"               9  "CONTINUOUS"     0.20     T      0      "Cross-HATching"                            )
   ( "ISO_LIN_ASS"        6  "ACAD_ISO10W100" 0.20     T      0      "ASSembly line"                             )
   ( "ISO_TEX_IDE"       70  "CONTINUOUS"     0.25     T      0      "Text for IDEntification of ports"          )
   ( "ISO_TEX_POS"        4  "CONTINUOUS"     0.25     T      0      "POSition number"                           )
   ( "ISO_TEX_DES"       50  "CONTINUOUS"     0.25     T      0      "Text for DEScription (12, 14, 89)"         )
   ( "ISO_LIN_PRE"       30  "CONTINUOUS"     0.20     T      0      "PREssure line"                             )
   ( "ISO_LIN_RES"      140  "CONTINUOUS"     0.20     T      0      "REServoir line"                            )
   ( "ISO_LIN_CON"       30  "ACAD_ISO02W100" 0.20     T      0      "CONtrole line"                             )
   ( "ISO_LIN_DRA"      140  "ACAD_ISO02W100" 0.20     T      0      "DRAin line"                                )
   ( "ISO_LIN_WOR"       70  "CONTINUOUS"     0.20     T      0      "WORking line"                              )
   ( "ISO_TEX_DES_025"       70  "CONTINUOUS"     0.25     T      0      "Text for DEScription 2.5MM"                )
   ( "ISO_TEX_DES_035"       30  "CONTINUOUS"     0.35     T      0      "Text for DEScription 3.5MM"                )
   ( "ISO_TEX_DES_050"       50  "CONTINUOUS"     0.50     T      0      "Text for DEScription 5.0MM"                )
   ( "ISO_TEX_DUT"               8  "CONTINUOUS"     -3       T      0      "Dutch text"                                )
   ( "ISO_TEX_ENG"               8  "CONTINUOUS"     -3       T      0      "English text"                              )
   ( "ISO_TEX_FRE"               8  "CONTINUOUS"     -3       T      0      "French text"                               )
   ( "ISO_TEX_GER"               8  "CONTINUOUS"     -3       T      0      "German text"                               )
   ( "ISO_LIN_DIM"               8  "CONTINUOUS"     -3       T      0      "Dimensions"                                )
   ( "ISO_LIN_SHE"               9  "CONTINUOUS"     -3       T      0      "Layout sheet frame"                        )
   ( "ISO_TEX_SHE"               9  "CONTINUOUS"     -3       T      0      "Layout sheet text"                         )
   ( "ISO_LIN_MAT_LIS"           9  "CONTINUOUS"     -3       T      0      "Layout material list"                      )
   ( "ISO_LIN_MAT_FRA"           8  "CONTINUOUS"     -3       T      0      "Layout material list frame"                )
   ( "ISO_LIN_MAT_POS"           7  "CONTINUOUS"     -3       T      0      "Layout material list position"             )
   ( "ISO_TEX_MAT"               7  "CONTINUOUS"     -3       T      0      "Layout material list text"                 )
   ( "ISO_LIN_TIT"               7  "CONTINUOUS"     -3       T      0      "Layout titleblock frame"                   )
   ( "ISO_LIN_LOG"              10  "CONTINUOUS"     -3       T      0      "Logo"                                      )
   ( "ISO_TEX_LOG"               7  "CONTINUOUS"     -3       T      0      "Layout titleblock logo text"               )
   ( "ISO_TEX_TIT"               7  "CONTINUOUS"     -3       T      0      "Layout titleblock text"                    )
   ( "ISO_LIN_VIE"             230  "CONTINUOUS"     -3      nil     0      "Layout viewports"                          )
   ( "ISO_LIN_ACT"             160  "CONTINUOUS"     -3       T      0      "Pneumatic actuators"                       )
   ( "ISO_LIN_VAC"              60  "CONTINUOUS"     -3       T      0      "Vacuum"                                    )
   ( "ISO_LIN_ALE"               2  "CONTINUOUS"     -3       T      0      "Pneumatic Air Line Equipment"              )
   ( "ISO_LIN_PRE_SWI"         200  "CONTINUOUS"     -3       T      0      "Pneumatic pressure switches"               )
   ( "ISO_LIN_PRO_VAL"         226  "CONTINUOUS"     -3       T      0      "Pneumatic proportional valves"             )
   ( "ISO_LIN_VAL"             240  "CONTINUOUS"     -3       T      0      "Pneumatic valves"                          )
   ( "ISO_LIN_SUB"               8  "CONTINUOUS"     -3       T      0      "Pneumatic sub-bases"                       )
   ( "ISO_LIN_ACC"              30  "CONTINUOUS"     -3       T      0      "Pneumatic accessories"                     )
   ( "ISO_LIN_CAB"               8  "CONTINUOUS"     -3       T      0      "Pneumatic cabinet"                         )
   ( "ISO_LIN_COM"               7  "CONTINUOUS"     -3       T      0      "Pneumatic components"                      )
   ( "ISO_LIN_SEC"               3  "CONTINUOUS"     -3       T      0      "Pneumatic conduct sections"                )
   ( "ISO_LIN_EXH"             104  "CONTINUOUS"     -3       T      0      "Pneumatic exhaust"                         )
   ( "ISO_LIN_OVE"               1  "CONTINUOUS"     -3       T      0      "Pneumatic override"                        )
   ( "ISO_LIN_PIL"               1  "CONTINUOUS"     -3       T      0      "Pneumatic pilot"                           )
   ( "ISO_LIN_RET_SPR"           1  "CONTINUOUS"     -3       T      0      "Pneumatic return spring"                   )
   ( "ISO_LIN_ELE_COM"           1  "CONTINUOUS"     -3       T      0      "Electric components"                       )
   ( "ISO_LIN_ELE_WIR"           8  "CONTINUOUS"     -3       T      0      "Electric wires"                            )
   ( "ISO_LIN_LAB"              10  "CONTINUOUS"     -3       T      0      "Labels"                                    )
   )
 )
)

 

acadiso.dwg

 

 

 

SB

Link to comment
Share on other sites

 (
   (lambda ( lst / lts ) (setq lts (vla-get-Linetypes (vla-get-ActiveDocument (vlax-get-acad-object))))
     (mapcar 'cons (mapcar 'car lst)
       (mapcar
         (function
           (lambda ( x )
             (and (caddr x)
               (or (tblsearch "LTYPE" (caddr x))
                 (vl-catch-all-apply 'vla-load (list lts (caddr x) "[color=red]acadiso.lin[/color]"))
               )
             )
             (apply 'MakeLayer x)
           )
         )
         lst
       )
     )
   )

 

the line definition file should be correctly referenced in the code.

don't use the "description"- there be a bug there :twisted:

Link to comment
Share on other sites

  • 2 weeks later...

I think i didn' t get how to trigger the thing.

On (load"makelayers"), nothing happens.

Command: (load"makelayers")

LM:STR->LST

So i tried, LM:STR->LST, LM, STR->LST,... no reaction i can see...

Link to comment
Share on other sites

I think i didn' t get how to trigger the thing.

On (load"makelayers"), nothing happens.

 

So i tried, LM:STR->LST, LM, STR->LST,... no reaction i can see...

 

LM:str->lst is just a subfunction, use 'MakeLayers' (defined at the top) - I should've added a loading message.

 

You might like this novelty program:

 

http://lee-mac.com/getsyntax.html

Link to comment
Share on other sites

LM:str->lst is just a subfunction, use 'MakeLayers' (defined at the top) - I should've added a loading message.

 

You might like this novelty program:

 

http://lee-mac.com/getsyntax.html

 

 

Lee, in the getsyntax.lsp program, how can one define a unique search directory instead of the default which, in my case, is C:\users\something\documents ?

in other words, can it be set or hard coded to whatever the user wishes? which should be the directory where all the lisps are kept ?

thx, Steve

Link to comment
Share on other sites

Lee, in the getsyntax.lsp program, how can one define a unique search directory instead of the default which, in my case, is C:\users\something\documents ?

in other words, can it be set or hard coded to whatever the user wishes? which should be the directory where all the lisps are kept ?

thx, Steve

 

Hi Steve,

 

You can hard-code a directory here [Line 28] (Currently an empty string):

 

(getfiled "Select LISP File to Query" "[color=red][b]C:\\MyFolder\\MyDirectory[/b][/color]" "lsp" 16)

Lee

Link to comment
Share on other sites

Hi Steve,

 

You can hard-code a directory here [Line 28] (Currently an empty string):

 

(getfiled "Select LISP File to Query" "[color=red][b]C:\\MyFolder\\MyDirectory[/b][/color]" "lsp" 16)

Lee

 

I understand !!! now I know what those two "" were for in the original program, they forced the default location. Thank you ! !

Steve

Link to comment
Share on other sites

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...