Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

File Open Lisp

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
wsargent
2302 Views, 6 Replies

File Open Lisp

I have a AutoLISP file that runs when a fiile is opened. This file sets basic parimaters for AutoCAD that should not change. As part of this file the color, linetype and line weight are set to bylayer. This turns on the Hide/Show lineweights toggel. To turn it back off I set the lwdisplay to 0, but when the file opens it is still set to 1. What am I doing wrong?

 

ACADDOC.lsp:

 

 (setvar "cmdecho" 0)                                    ; Hides commands form desplaying on command line

 (setvar "peditaccept" 1)                                ; Removes confirmation when slecting non-pnlylines with pedit

 (setvar "plinegen" 1)                                     ; sets polyline linetype generation to enabled

 (command ".viewres" "y" 5000)                    ; Smoths cirves

 (setvar "selectionannodisplay" 0)                 ; Turn off ghosting of annotative objects

 (setvar "filedia" 1)                                         ; Turns on dialog boxes

 (setvar "plinetype" 2)                                    ; convets all 2D polylines to optimized polylines

 (command "taskbar" 1)                                 ; Alows open drawing slection in Windowns 7

 (command ".visretain" 1)                              ; Sets all VisRetain to 1, allowing x-ref laysers to be modifed

 (command ".mirrtext" 0)                                ; Allows text to be mirrored without reversing the letters

 (command "-color" "BYLAYER")                   ; Sets color property to by layer

 (command "-linetype" "set" "BYLAYER" "")  ; Sets linetype property to by layer

 (command "-lweight" "BYLAYER")               ; Sets lineweight property to by layer

 (setvar "lwdisplay" 0)                                    ; Toggles off the Show/Hide Lineweight button

 (command "msltscale" 1)                             ; Turns on Modle Space line type scale

 (command "geomarkervisibility" 0)              ; Turns off Geo-spacial marker

 (command "_layiso" "Settings" "off" "Off" "")   ; Sets layer isolate to turn off layers not slected

 (setvar "cmdecho" 1)                                    ; Turns of the Hide command

 

__________

AutoCAD Civil 3D 2016 SP3.0, built on: AutoCAD 2016 SP1, Map 3D 2016 SP2
Dell Percision T5810: MS Windows 10 Pro; Intel Xeon CPU E5-1620 v3 @ 3.50 GHz, 16.00 GB RAM, NVIDIA K2200 4.00 GB Memory
6 REPLIES 6
Message 2 of 7
scot-65
in reply to: wsargent

>> (command "-lweight" "BYLAYER")               ; Sets lineweight property to by layer

 

(setvar 'CELWEIGHT -1)

 

Also look into CECOLOR, CELTYPE, CELTSCALE.

 

Old school "CE" method still works.

 

???

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 3 of 7
wsargent
in reply to: scot-65

Thank You. I am still learning AutoLISP the hard way. I wish I could find a good book to learn from.

 

I have cleaned up the text to this:

 

(setvar 'cmdecho 0)                                    ; Hides commands form displaying on command line

 

;;; Function

 (setvar 'peditaccept 1)                                ; Removes confirmation when selecting non-pnlylines with pedit

 (setvar 'filedia 1)                                    ; Turns on dialog boxes

 (setvar 'visretain 1)                                  ; Sets all VisRetain to 1, allowing x-ref laysers to be modified

 (setvar 'mirrtext 0)                                   ; Allows text to be mirrored without reversing the letters

 (command "taskbar" 1)                                  ; Allows open drawing selection in Windows 7

 

;;; Display

 (setvar 'selectionannodisplay 0)                       ; Turn off ghosting of annotative objects

 (setvar 'mtjigstring "PKCE")                           ; Sets text sample string

 (setvar 'plinegen 1)                                   ; sets polyline linetype generation to enabled

 (setvar 'lwdisplay 0)                                  ; Toggles off the Show/Hide Lineweight button

 (setvar 'msltscale 1)                                  ; Turns on Model Space line type scale

 (setvar 'geomarkervisibility 0)                        ; Turns off Geo-spacial marker

 (setvar 'whiparc 0)                                    ; Smooth circles

 (command "_layiso" "Settings" "off" "Off" "")          ; Sets layer isolate to turn off layers not selected

 

;;; Properties

 (setvar 'CECOLOR "BYLAYER")                            ; Sets color property to by layer

 (setvar 'CELTYPE "BYLAYER")                            ; Sets linetype property to by layer

 (setvar 'CELWEIGHT -1)                                 ; Sets the lineweight to "BYLAYER."

 (setvar 'CELTSCALE 1)                                  ; Sets the LTScale of new objects to 1.

 (setvar 'plinetype 2)                                  ; convents all 2D polylines to optimized polylines

 

I would like to remove the last two commands and only use the associated variable, but I don't know how to look that up.

__________

AutoCAD Civil 3D 2016 SP3.0, built on: AutoCAD 2016 SP1, Map 3D 2016 SP2
Dell Percision T5810: MS Windows 10 Pro; Intel Xeon CPU E5-1620 v3 @ 3.50 GHz, 16.00 GB RAM, NVIDIA K2200 4.00 GB Memory
Message 4 of 7
mgalicki
in reply to: wsargent

I know this is old post but related to my question.

just started this strange issue.

Every file I open creates & changes the layer to revcld with this at the command prompt

s::startup-load

 

Here is the info when a file is loaded.

 

AutoCAD menu utilities loaded.
VSF.LSP for AutoCAD is loaded.
To view a slide of the fraction chart type VSF.
lrgflngs.LSP for AutoCAD is loaded.
To view a slide of the fraction chart type lrg_flngs.
PIPE.LSP for AutoCAD is loaded.
To view a slide of the Pipe properties chart type PIPE.
 >>    Draw revcld, please      >>
Unknown command "REVCLD".  Press F1 for help.
*Cancel*

 

Any ideas how to get rid of this behavior?

Thank you,

Mark

Everything in existence was first an Idea
Autodesk Plant 3D Premium 2019
Autodesk MEP 2019
HP 3.2 Ghz CPU 16 ram
1TB 7200 rpm SATA 6Gb/s hard drive
2GB DDR3 NVIDIA GeForce GTX 680ti
HP 2311x 23" LED Monitor
Message 5 of 7
Kent1Cooper
in reply to: mgalicki

Do you have an acaddoc.lsp file that's doing these things?  If you're not sure, type in:

 

(findfile "acaddoc.lsp")

 

and it will show you whether there is one, and if so, where it is.  Open that in Notepad to see what's in it.

Kent Cooper, AIA
Message 6 of 7
mgalicki
in reply to: Kent1Cooper

Where do I type this at?

Windows search bar, not in AutoCAD right??

 

Thanks

Everything in existence was first an Idea
Autodesk Plant 3D Premium 2019
Autodesk MEP 2019
HP 3.2 Ghz CPU 16 ram
1TB 7200 rpm SATA 6Gb/s hard drive
2GB DDR3 NVIDIA GeForce GTX 680ti
HP 2311x 23" LED Monitor
Message 7 of 7
Kent1Cooper
in reply to: mgalicki


@mgalicki wrote:

Where do I type this at?

Windows search bar, not in AutoCAD right??

 

Thanks


No, at the command line when in an AutoCAD drawing.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost