AutoCAD Visual LISP / AutoLISP :: Toggle Drawing Units

Nov 28, 2013

Is there a way of opening existing cmds in the visual lisp editor and edit them to do something else? I'd like to set up a lisp where 'uu' would switch the drawing units from decimal to architectural units and hittng 'uu' again would switch it back.

View 4 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Toggle Between PS And MS

Nov 8, 2011

I upgraded from Autocad 2004 to 2012 recently and my lisp file doesnt work anymore.

what it's supposed to do is when looking at the layout tab that you want you can switch to the model space location of the same zoom as the layout tab without messing with the layout zoom.

(defun c:msp ()
(setq cm (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command"view" "d" "tmp")
(setvar "tilemode" 0)
(command"pspace")
(princ "Click TWICE on desired VPORT: ")
(command "mspace" pause "view" "s" "tmp")(princ)
(setvar "tilemode" 1)
(command "view" "r" "tmp")
(setvar"cmdecho" cm)
(princ)
)

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Toggle Between Two Functions

Nov 21, 2011

I’m having a mental collapse blank today. I'm trying to write a lisp that toggles between two custom lisp/ functions.

just incase, the lisp is to be incorporated into a button...

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Brackets In Alternate Units?

Jan 30, 2002

Brackets in alternate units ...?

Is there any possible way to eliminate the brackets from around Alternate Units? I could swear I've seen a routine around that enables you to do this.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sort List Of Lists By Size Of Units?

May 2, 2013

I am trying to sort a list of lists by the size of units.

Here is the unsorted list -

(setq List_Blocks
  (list
    (list "10x10" "UNIT DOWN-CC" 56)
    (list "7.5x10" "UNIT DOWN-CC" 20)
    (list "5x5" "UNIT DOWN-CC" 34)
    (list "10x15" "UNIT EXTERIOR" 32)
    (list "5x10" "UNIT DOWN-CC" 31)
    (list "10x20" "UNIT EXTERIOR" 24)
    (list "10x30" "UNIT EXTERIOR" 13)
    (list "10x25" "UNIT EXTERIOR" 2)
  )
)

I would like the list sorted by the first number before the "X" and then by the second number after the "X".

Example of sorted list -

    (list "5x5" "UNIT DOWN-CC" 34)
    (list "5x10" "UNIT DOWN-CC" 31)
    (list "7.5x10" "UNIT DOWN-CC" 20)
    (list "10x10" "UNIT DOWN-CC" 56)
    (list "10x15" "UNIT EXTERIOR" 32)
    (list "10x20" "UNIT EXTERIOR" 24)
    (list "10x25" "UNIT EXTERIOR" 2)
    (list "10x30" "UNIT EXTERIOR" 13)

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Toggle Between Customized Old Style Menus / New Style Workspaces?

Nov 13, 2011

Is there a way to toggle between customized old style menus and new style workspaces?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Saveas Drawing With Default Drawing Name

Oct 13, 2013

I am trying to put together a lisp routine for exporting a Civil3D drawing to basic autocad entities and convert it to a clients layer standards.

I don't want any user input, so I see two problems with the routine at the moment.

Step 2. SAVEAS - I want the drawing to be saved in the same directory as the current drawing, either called "CLIENT_export.dwg" or preferably "Export_{current drawing name}.dwg". If the dwg exists I want it either to overwrite or increment a suffix number.

Step 4. At the moment it askes the user for a selection, I want it to select "ALL"

;;;Purpose to convert a Civil3D drawing into CLIENT layer standards.

(defun c:client ()
(setq old-echo (getvar "CMDECHO"))
(setvar "cmdecho" 1)

[Code]...

I don't have any experience with LISP or any other programming. I have just been cobbling this together from bits and pieces I have found on the web.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Another Drawing Layout Tabs Contents In Current Drawing

Mar 7, 2013

I want to insert another drawing layout tabs contents in current drawing.

It's easy for MODEL tab, but for LAYOUT tabs, I dont know how!?

I prepared a code for INSERTING MODEL tab in current drawing:
 
(defun INS_DWG (TAB path dwg P / blk)(setq blk (strcat ""*" path dwg """));(setq N (vla-get-count (vla-get-layouts)));;Number of LAYOUT TABS in dwg(if (or(= TAB 0) (= TAB nil))(command "INSERT" blk P 1 0)); TAB=0 or omitted ==>Insert MODEL;(if (= TAB 1));==>Insert the 1st LAYOUT in dwg file;(if (= TAB 2));==>Insert the 2nd LAYOUT in dwg file;and so on....);;;usage:;;(INS_DWG 0 "c:\test\" "test.dwg" '(0 0))

View 8 Replies View Related

CorelDRAW Graphics Suite X4 :: Toggle Between Drawing Units

Dec 11, 2010

I need to use both inches and mm for my designs constantly ,is there a keyboard shortcut to make that happen?

View 10 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Delete All OLE Objects From Drawing

Nov 26, 2012

how to delete all OLE objects from drawing by most efficient way.

There are abt 150 drawings, each has from 2 to 20 or so OLE objects which need to be deleted. OLE objects are on many paper spaces.

I tried to use qselect but it selects only what is in current space.

Would need some lisp or some other methode than all can be deleted (excluding those which resides in blocks).

Tried also yto use ssx and then erase but still it deletes only what is on current space.

Just as additional info, those OLE are all pictures, not xls files for example.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Open Drawing Read-only?

Oct 18, 2002

How can you open a drawing read-only with autolisp.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Text To All Dtext In A Drawing

Oct 7, 2011

Any lisp routine out there to append (prefix) text to dtext?

i have 100s of dtext that has numbers in them, and i need to place the "#" symbol in front of them now.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert One Or Another Block Into Drawing

Apr 22, 2013

I am trying to insert one or another block into a drawing, and i need to do this 8 times per drawing. 

(defun C:detector (/ filename gas pressure)
(repeat 8 (initget 1 "Gas Pressure")
(setq filename (getkword "
Enter Detector Type [Gas/Pressure]: "))
(if (= filename "gas") (command "-insert" "*T:\acad\schematic_circuits\suny\sunygasdetectornew.dwg" pause "" "")
(or (if (= filename "pressure")
(command "-insert" "*T:\acad\schematic_circuits\suny\sunypressuretransmitternew.dwg" pause "" ""))
) ;;end or
) ;;end if
) ;;end repeat
)

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Showing Tubes While Drawing

May 27, 2012

I am working on a lisp that automaticaly draws some tubes and fittings.First the user has to select the block where the tubes start and then he selects where the tubes has to end.Herefor i whrote this lisp..

(defun c:test () ;;------------=={ Set Dynamic Property Value }==--------------;;;;;;;; Modifies the value of a Dynamic Block Property ;;;;-------;;;; Author: Lee Mac, Copyright © 2010 - www.lee-mac.com ;;;;---------------------;;;; Arguments: ;;;; block - VLA Dynamic Block Reference Object ;;;; prop - Dynamic Block Property Name ;;;; value - New value for Property ;;;;------------------;;;; Returns: Value property was set to, else nil ;;;;-------------------;;(defun LM:SetDynamicPropValue ( block prop value ) (setq prop (strcase prop)) (vl-some (function (lambda
[code]....

Is it posible to show the user how the tubes gow befor chozing the second point?(A litle bit like when you stretch a dynamic block where you can see how the object will look like while preforming the stretch action).

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Number Of Layouts In Another Drawing

Oct 4, 2013

As you smart individuals can figure out, we do up drawing packages for construction that consist of several drawings, hundreds of drawings, for several modules of construction.  Our process usually consists of one layout per drawing, so that the lisp guy can do a drawing count and put in sheet numbers based on how I manipulate the list of drawings in the one directory folder.

Now I have a client, despite the way we currently do things, requires that about 70% of the drawings will have multiple layouts.  Now we're back in the stone ages, manually putting in sheet numbers, eating up our budget for this contract.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Use It For Drawing Lines Between Two Points

Aug 19, 2013

how to use AutoLISP to draw lines between two points. I have x,y,z coordinates for the end points in an excel sheet which I can save as a text file. I need to pull the coordinates from the file and use them to draw the lines. There are 2000+ lines so it is not feasible to draw them manually.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: List Of Drawings From One Drawing To Next

Dec 5, 2012

I have the following string of code, that I'll write in everyone's start-up suite. I'm able to retrieve a list of files I want to modify, for whatever reason.  (One example, when plotting drawings with layouts, sometimes the shadeplot setting is wireframe, and not classic hidden, though it's been set up in our templates).

The huge question is, can I get a list of drawings to a variable in one drawing, and have access to that variable list, in the next drawing I open?  I'll iron out the bugs on read-only statuses, or manipulating drawing states later.

(defun GetDrawings ()
(setq currentpath (getvar "dwgprefix"))
(command "pspace")
(setq DrawingList (dos_getfilem "Select a file" currentpath "Drawing files (*.dwg)|*.dwg|All files (*.*)|*.*||"))
(setq ListOfDrawings (cdr DrawingList))
(setq DrawingPath (nth 0 DrawingList))
[code]...

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Exports Entities From One Drawing To Another

Oct 2, 2011

I know through the block command you can write out a selection of entities to a single drawing.But what I am wondering is if it is possible to have two drawings open, and transfer data quickly between the two?

As an example as we are detailing an assembly we create a title block around a detail, put dimensions and notes on as needed and would then like that to be transfered into another drawing next to the previously transfered detail drawing.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Rounding Up Drawing Measurements To The Next Whole Cm

Jul 30, 2013

I'd like to create a lisp that would check my drawings for stray vertices (I only draw in full measurements per UCS), and automatically round them up to the closest whole value, or at least mark them up in circles for manually fixing them.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Drawing Rectangle Between Lines

Aug 9, 2013

I need lisp that draws rectangle between two lines by window selection. As attached.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Start It With No Drawing Open?

Nov 13, 2001

can you start autocad with no drawing open ?

i would think that some type of script would work or could you change your target on a shortcut?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Drawing Two Different Lines Over Each Other In One Step

Dec 5, 2011

I want to draw a line which shows a particular color scheme, I at current do this by drawing a solid line of one color and then use a dashed line of another color top go over it.

The obvious problem is that these lines are being double drawn. Is there a way using lisp that I can draw both lines at once?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Annotative Drawing Scale

Apr 26, 2012

I am attempting to create an AutoLISP that removes all un-used drawing scales from a file, then adds the standard scales used in civil engineering. This is what I tried using:

;;;Add Engineering Scales
(defun C:AES ()
 (command ".CANNOSCALE"
   "1" = 1'"
 (command "-scalelistedit"
[code]...

Now, I am only a beginner to writing LISP, but I know that my problem is that it is reading the inch marks after the one in the scale name as a enter, but I don't know how to get around this. Also, I don't know how to get it to skip scales that are still in the drawing.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Export Parts Of Drawing To Another DWG

Oct 1, 2012

i have one big pipeline drawing and need to "split" it into smaller drawings..there are layers, v500, v250, v100 that represent size of pipeline.i'd like to extract all elements from layer v500  to drawing v500.dwg, after that v250... etc.

problem is that i would select only elements from v500, erase all other and than save it as v500.dwg... and then what? undo all and repeat everything with another layer?

is there a way to copy elements to another drawing and save and then return to original drawing and execute another set of commands?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Two Lines In Drawing - How To Flatten

Jun 19, 2013

There are two lines in attached drawing. It seems FLATTEN doesn't work on them. How can I flatten them with lisp code?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Reload Routine For Every Drawing

Oct 16, 2013

I recently upgrading to ACA 2014. I have set my trusted locations, my file path, the startup suite, and the system variable to load acad.lisp on startup. Most of my lisp routines load, but not all. I still have my ACA 2011 loaded, all settings are applied as required, yet I do not have the same issue with the same lisp routines. I have to reload my lisp routines for every drawing.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create Macros Of A Drawing

Aug 6, 2012

How to create macros of a drawing and then hw can we change the drawing by editing the macro. E.g.. I have drawn a circle of 30 mm dia.. than need to crate macros for same and then by changing the dia of circle in macros I want to create new circle of 50 mm dia.

Another thing I wanted to ask is what is difference between visual lisp and visual basic. Which is easier??

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create Some Plines In A Drawing

Sep 10, 2013

I have to create some plines in a drawing from the inputs provided by the client. I prepared a lisp code for it. I have to use it to 1000 drawings. Every time I open the drawing and running the lisp command.

Is any lisp code to run in bulk open drawings with out entering command prompt.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Creating New Drawing With Specific Template

Sep 20, 2013

I have some code that starts a new drawing with a specific template from a lisp routine

(defun ghd:load_newdwg (template / ae-acad-object newdwg)
  (setq ae-acad-object (vlax-get-acad-object))
  (setq newdwg (vla-add (vla-get-documents ae-acad-object) template))
  (vla-put-activedocument ae-acad-object newdwg)
)

The template location and file is stored in variable clienttemplate (and is not the standard template path set under options). All works okay except if I close the new drawing, when I return to the previous drawing that was current when the new drawing was created (i.e. the drawing that the routine was run from). I get the following error:

Command: ; error: Exception occurred: 0xC0000005 (Access Violation)
; error: Unknown exception occurred
; warning: unwind skipped on unknown exception

I assume this has something to do with the original routine not closing/finishing before switching to the new drawing. This is the last line of the routine:

(cond ((= startnewdwg 1) (ghd:load_newdwg clienttemplate)))

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Layer Name And Description As Text In The Drawing?

Nov 14, 2013

is it possible to make a LISP program whcih write down my layer name and description as text or Mtext in the drawing, so it will look like:

A_Wall architecture wall

A_Column architecture column

something like that.Each text, which is written in the drawing should have the same layer like the layer name.

the closest i can get is this code below, which write the layer as text, but what missing is: i want to add the description behind the layer name:

(defun c:layerlegend (/ osm ortho clayer celtype cecolor start-point line-length text-height *error*)
(defun *error* (msg)
(setvar "osmode" osm)
(setvar "orthomode" ortho)
(setvar "clayer" clayer)
(setvar "celtype" celtype)
(setvar "cecolor" cecolor)
(princ msg)
)

[code]...

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Automated Drawing Using Input Data?

Jul 4, 2013

I would like to automate drawing process for certain data. Using some LISP codes User will be asked to provide some data and using that data an automatic drawing needed to be developed at Drawing editor of AutoCAD. For example;

Enter the width of Sheet: 50 mm
enter the length of Sheet: 200 mm
Enter the sheet thickness: 5mm
Enter type of feed: Automatic
Are there holes in Strip: Yes/No
Specify nu of holes: 5
Position of holes Centre: 5,5
Distance between the holes:  At an interval of 20mm each

I just need a LISP code for such program.

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved