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

Creating an export Command

1 REPLY 1
Reply
Message 1 of 2
wsargent
317 Views, 1 Reply

Creating an export Command

I am attempting to create a export command for our surveyors that deletes all there point layers and seal layer, then audits and saves the file before opening the etransmit command. I only have a basic understainding of AutoLISP and have not found a book on the subject. Please help.

 

Below is what I currently have.I know there is a better way to do this, but it is above my programing skill right now.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	SURVey export
(defun C:SRVY ()
 (command "-laydel"                                    ; Delete Survey data
   "Name" "F0" "Name" "F1" "Name" "F2" "Name" "F3"
   "Name" "F4" "Name" "F5" "Name" "F6" "Name" "F7"
   "Name" "F8" "Name" "F9" "Name" "F10" "Name" "F11"
   "Name" "F99" "Name" "SHEET-SEAL" ENTER "YES"
   )
 (command ".audit" "y")                                ; Audits file
 (command "_qsave")                                    ; Save changes
 (command "-etransmit" "Choose Setup" "ACAD2010"
   "Create transmittal package"
   )
 (princ)
)

 

 Thanks in advance.

__________

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
1 REPLY 1
Message 2 of 2
Moshe-A
in reply to: wsargent

Hi,

 

take a look at these corrections:

 

(defun C:SRVY ()
 (command "._laydel"                                 ; Delete Survey data
   "Name" "F0" "Name" "F1" "Name" "F2" "Name" "F3"
   "Name" "F4" "Name" "F5" "Name" "F6" "Name" "F7"
   "Name" "F8" "Name" "F9" "Name" "F10" "Name" "F11"
   "Name" "F99" "Name" "SHEET-SEAL" "" "YES"
 )

 (command "._audit" "y")                                ; Audits file
 (command "._qsave")                                    ; Save changes
 (command "._etransmit" "Choose Setup" "ACAD2010"
          "Create transmittal package" (getvar "dwgname"))
 (princ)
)

 

in the call to (command "LAYDEL")  an ENTER is not a reserved word/variable that known to AutoLISP

instead A null string ("") is equivalent to pressing ENTER on keyboard.

 

in the call to (command "ETRANSMIT") a transmital setup ACAD2010 must exist in every dwg that is

opened otherwise the SRVY command will fail.

 

also take in consideration  that SRVY may fail if AUDIT is not complete or some errors

will raise in the etransmit process.

 

Moshe

 

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

Post to forums  

Autodesk Design & Make Report

”Boost