- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a custom LISP file listed below...Normally, I manually run this command, but there are times I want it to run on Startup and blast through hundreds of files one after the other...so, I put ";;" in front of my "defun c:G ()", and remove it from in front of "(defun-q S::STARTUP()". Then, using Windows Powershell, I run a command to open all the DWG files I need this LISP command to run in. The problem I am having is when the STARTUP runs my command, for some reason, it's tossing the _HELP command in between the commands in my LISP file. Now, my command will continue and process as it should, but every time a new file is ran, the Help menu opens and closes at the end of my custom LISP. I do NOT have this issue when I run the LISP manually. Can anyone give me a pointer to how to keep this from happening?
CUSTOM LISP
;;(defun-q S::STARTUP()
(defun c:G ()
;; Delete DEFPOINTS layer if it exists
(if (tblsearch "LAYER" "DEFPOINTS")
(command "_.LAYDEL" "N" "DEFPOINTS" "" "YES")
)
;; Select objects on layer "0"
(setq ss (ssget "_X" '((8 . "0"))))
;; Delete selected objects
(if ss
(command ".erase" ss "" "")
)
(command "purge" "A" "*" "N")
(command "UCS" "W")
(command "-VIEW" "SW")
(command "ZOOM" "_E")
(command "VSCURRENT" "R")
(command "VSEDGES" "0")
(command "VSCURRENT" "2")
(command "OSMODE" "0")
(command "-LAYER" "M" "" "")
(command "_point" "0,0,0")
;;(command "._QSAVE")
(vla-saveas (vla-get-activedocument (vlax-get-acad-object))
(strcat (getvar 'dwgprefix)
(if (getvar 'dwgtitled)
(getvar 'dwgname)
"Drawingname"))
ac2004_dwg)
;;(command "OSMODE" "11")
;;(princ "\nVERY GOOD!")
;;(princ)
(command ".CLOSE")
);END
AUTODESK COMMAND LOG
[ AutoCAD - Wed Jul 17 11:33:25 2024 ]----------------------------------------
Opening an AutoCAD 2004/LT 2004 format file.
Regenerating model.
AutoCAD menu utilities loaded.
Command:
Autodesk DWG. This file is a TrustedDWG last saved by an Autodesk application or Autodesk licensed application.
Command:
Command: .erase
Select objects: 1 found
Select objects:
Command: _HELP <-----------------------------------------WHY?????
Command: purge
Nested items = Off Orphaned data = Off
Enter type of unused objects to purge [Blocks/DEtailviewstyles/Dimstyles/Groups/LAyers/LTypes/MAterials/MUltileaderstyles/Plotstyles/SHapes/textSTyles/Mlinestyles/SEctionviewstyles/Tablestyles/Visualstyles/Regapps/Zero-length geometry/Empty text objects/Orphaned data/All]: A Enter name(s) to purge <*>: * Verify each name to be purged? [Yes/No] <Y>: N
No unreferenced blocks found.
No unreferenced layers found.
No unreferenced linetypes found.
No unreferenced text styles found.
No unreferenced shape files found.
No unreferenced dimension styles found.
No unreferenced mlinestyles found.
No unreferenced plotstyles found.
No unreferenced table styles found.
No unreferenced materials found.
No unreferenced visual styles found.
No unreferenced multileader styles found.
No unreferenced groups found.
No unreferenced Detail view styles found.
No unreferenced Section view styles found.
Command: UCS
Current ucs name: *WORLD*
Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis] <World>: W
Command: -VIEW Enter an option [?/Delete/Orthographic/Restore/Save/sEttings/Window]: SW Regenerating model.
Command: ZOOM
Specify corner of window, enter a scale factor (nX or nXP), or
[All/Center/Dynamic/Extents/Previous/Scale/Window/Object] <real time>: _E
Command: VSCURRENT
Enter an option [2dwireframe/Wireframe/Hidden/Realistic/Conceptual/Shaded/shaded with Edges/shades of Gray/SKetchy/X-ray/Other] <2dwireframe>: R
Command: VSEDGES
Enter new value for VSEDGES <1>: 0
Command: VSCURRENT
Enter an option [2dwireframe/Wireframe/Hidden/Realistic/Conceptual/Shaded/shaded with Edges/shades of Gray/SKetchy/X-ray/Other/cUrrent] <Current>: 2 Regenerating model.
Command: OSMODE
Enter new value for OSMODE <0>: 0
Command: -LAYER
Current layer: "0"
Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: M
Enter name for new layer (becomes the current layer) <0>: Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]:
Command: _point
Current point modes: PDMODE=0 PDSIZE=0.000
Specify a point: 0,0,0
Command: .CLOSE
Command: ; error: Function cancelled
Solved! Go to Solution.