Documentos de Académico
Documentos de Profesional
Documentos de Cultura
SITE MAP
ABO UT
NEW SLETTER
CO NTACT
User Name
Password
Log in
Help
Register
Remember Me?
Tutorials
Michaels Corner
Forum
W hat's New ?
Links
Quick Links
Forum
AutoCAD Customization
Application Archive
VB.NET for AutoCAD Books, Training, and Consulting for AutoCAD and VB.NET www.vbcad.com Autodesk 3D Mech Design Go beyond 3D design to digital prototyping with Autodesk Inventor www.3eos.com Inventor 3D Manufacturing Optimize your CAD investment Autodesk Manufacturing Specialist www.tatatechnologies.com/autodesk
Welcome to the CADTutor forums, probably the most lively and friendly AutoCAD forums on the w eb. You w ill need to register in order to post a question and to see all the content on this board. See How to register for details. Use the Lost password recovery form if you ever forget either your passw ord or username. Be sure to check out the FAQ for more information.
+ Reply to Thread
Results 1 to 3 of 3
#1
CADTutor
Administrator
All of the lisp code posted on this bulletin board may be run on your own installation of AutoCAD. The basic process is pretty simple and is set out below. There are 3 main steps, creating the lisp file, loading the lisp file and running the lisp routine. Note: AutoLISP routines will only run on full versions of AutoCAD, they will not run on AutoCAD LT.
(defun c:zone ( / ss la rv i tv op en ) (while (not ss) (princ "\nPick any object o n the required layer") (setq ss (ssget))) (initget "Length Area") (setq rv (getkword "\nWould you li ke to measure Length/<Area> : ")) (and (not rv) (setq rv "Area")) (setq la (cdr (assoc 8 (entget (ss name ss 0)))) ss (ssget "X" (list (cons 0 "*POLYLINE") (cons 8 la))) i (sslength ss) tv 0 op 0) (while (not (minusp (setq i (1- i) ))) (setq en (ssname ss i)) (command "_.AREA" "_E" en) When you have (cond ((= code into Notepad, you pasted the rv "Length")
converted by Web2PDFConvert.com
You must now save the file. You can call it whatever you like as long as it has a .LSP file extension but it is always a good idea to give the file the same name at the lisp routine to avoid confusion. You will always find the name of the routine preceded with a c: at the beginning of the code. In the example above, you will see that that the routine is called "zone". So, in this case, the file should be saved as zone.lsp.
Use the following sequence to load zone.lsp: 1. Navigate to the folder where you saved the lisp file. 2. Select the file you want from the list. 3. Click the Load button. If all went well, you will see a message saying "zone.lsp successfully loaded". 4. Click the Close button to close the dialogue box.
converted by Web2PDFConvert.com
#2
Lee Mac
Quantum Mechanic
Computer Details Using: AutoCAD 2010 Join Date: Aug 2008 Location: London, England Posts: 12,792
VLX/FAS Files
You may discover that some programs are posted in the form of either a .VLX or .FAS file. These are programs that have been compiled into one file to make them not only easier to load (with only one file to deal with), but also more secure as far as code protection is concerned. To load a .VLX or .FAS file, just save the file to a known location, and follow the instructions in the above post, as if you were dealing with a LISP file. Of course, the syntax to invoke the function is not readily available, but may be either provided by the program developer, or appear at the command line upon loading the file.
DCL Files
DCL (Dialog Control Language) gives the user the ability to create dialog boxes with relative ease. These files run in conjunction with LISP files, and may be compiled with the relevant LISP file into a VLX or FAS file. DCL language looks like this: Code:
// Increment Numerical Text Sign Selector adder : dialog { label = "Specify Increment Direction"; : text { label = ""; key = "sel_text"; alignment = centered; } : row { : button { label = "+1"; key = "sel_add"; fixed_width = true; mnem onic = "+"; } : button { label = "-1"; key = "sel_sub"; fixed_width = true; mnem onic = "-"; } } // row ok_only; } // dialog
To run a program that uses a DCL file, save the provided DCL file into your AutoCAD Search Path. The AutoCAD Search Path is normally found: C:\Program Files\AutoCAD <version>\Support\ But additonal Search Path locations may be added by going to: Tools > Options > Files (tab) > Support File Search Path And adding a new filepath. The LISP file associated with the DCL file can be loaded and run as normal, using the instructions provided in the above post. If you are still puzzled, search the forums, or our FAQ for more information.
#3
Lee Mac
Quantum Mechanic
converted by Web2PDFConvert.com
Quantum Mechanic
Computer Details Using: AutoCAD 2010 Join Date: Aug 2008 Location: London, England Posts: 12,792
The error normally occurs because the Visual LISP functions that many developers use need to be loaded before use. Many users will have (vl-load-com) in their ACADDOC.lsp/ACAD.lsp files so that it may be loaded on startup; hence, when testing code, a developer may not notice the omission of (vl-load-com).
Example:
Code missing (vl-load-com) : Code:
Corrected: Code:
If you are still stuck, search the forums/FAQ for more help.
+ Reply to Thread
Previous Thread | Next Thread
Bookmarks Posting Permissions
Quick Navigation
You may not post new threads You may not post replies You may not post attachments You may not edit your posts
BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
Ads by Google
AutoCAD
AutoCAD LT 2011
CAD Tutorials
converted by Web2PDFConvert.com