Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual LISP 2

Status
Not open for further replies.

crystalrae

New member
Dec 13, 2000
54
Does any one know if this exists and if so where I can get general information on it at?
 
Replies continue below

Recommended for you

The Autodesk website has info on Viual LISP. You may want to look into using VBA for programming AutoCAD. It is much easier to learn and can do just about anything.
 
If you are working with AutoCAD2000, then you already have Visual Lisp.

On Command line of Acad just type:

VLIDE

and Visual Lisp window should open.

It having its own menu and Help in the menu, the rest is easy.

A few tricky turns exist of course and easier to ask them here then go trial-error.

Hope this helps.

 
I actually need it for R14 - work hasn't upgraded yet.
 
Oh, sorry.

Visual Lisp for Acad 14 can be bought as a separate CD. Cost is trivial. The free downoadable Beta version is somewhere on AutoDesk site but has expired. I had once downloeded it to find that out.

In the meantime, I mean until you upgrade to Acad2000, and Vlisp comes with it, you can ask for any functionality and I will gladly write and post it.

Come to think of it, The Visual Lisp we are talking about is only the text editor platform with help and nothing else. Meaning, Lisp routines are just text files - write in any text editor and save as mySomething.lsp

The file extension must be .lsp so that it can be loaded from the Acad command line with

(load "mySomething")

Here is an example:
;------
;operates on ON layers only.
;connects lines into Pline but not existing plines.
;if existing plines are to be connected, first explode (ursprung)
;add to acad.lsp this -
;(load "joinlines")
;put this file (joinlines.lsp) into Acad\support\samurai
;if Pedit malfunctions: alternatives - ENTGET

(defun dxf (n ed) (cdr (assoc n ed)))


(defun C:On-Layers()
;get all layers in the drawing
(setq onlayers (list ""))(setq offlayers (list ""))
(setq layer1 (tblnext "LAYER" t))
(if (and (= 0 (dxf 70 layer1))(> (dxf 62 layer1) 0) )
(setq onlayers (append onlayers (list (dxf 2 layer1)))) )
(while (setq layer1 (tblnext "LAYER"))(progn

(if (and (= 0 (dxf 70 layer1))(> (dxf 62 layer1) 0) )
(setq onlayers (append onlayers (list (dxf 2 layer1))))
)
))


(setq onlayers (cdr onlayers))(princ)
(princ "\n\nThe Following layers are ON")(mapcar 'print onlayers)(princ "\n")
)



(defun C:JoinLines()
(command "cmdECHO" "0")
(setq OnLayers1 (C:On-Layers))

(foreach name1 Onlayers (progn ;foreach progn

(setq filt1 (list (cons 0 "LINE")(cons 8 Name1)))
(while (setq s1 (ssget "X" filt1)) ;while
(if (> (sslength s1) 0)
(command "Pedit" (ssname s1 0) "_Y" "_Join" s1 "" "")
)

);while

));foreach progn
(princ "\nNo simple-lines left on ON-layers. This Command ignores Off-layers and PolyLines")(princ)
(command "cmdECHO" "1")
)

(princ "\nSamurai commands Available:\non-layers, \njoinlines")(princ)
 
The handbook for Lisp commands is under
AutoCAD 14 Help >
Customization Guide > Part I - AutoLisp Reference

Hope this is useful.

A lisp routine for rotating a drawing to horizontal before plotting can be downloaded free from

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor