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


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Return A List Of Strings Of Layout Tabs In Drawing

Mar 6, 2013

(layoutlist) ... returns a list of strings of the layout tabs in the drawing.I've used this ages... Isn't it a core lisp function, or is it coming from express tools or somewhere else?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Attribute To Current Block In Drawing

Jan 22, 2013

i have a for example a block with one attribute and would like add a new attribute. i´m trying to read the current block and redefine - it comes a new attribute in propertieswindow but not graphical.

 (defun c:ent () (setq bn (getstring "
give a block name ")) (setq bez (getstring "
give a attribut name ")) (entmake (list (cons 0 "BLOCK")(list 10 0 0 0)(cons 2 bn)(cons 70 2))) (setq fe (entmakex (list (cons 0 "CIRCLE") (cons 8 "0") (cons 10 '(0 0 0)) (cons 40 1)))) (entmake (list (cons 0 "ATTDEF") (cons 8 "0") (cons 10 '(0 0 0)) (cons 11 '(0 0 0)) (cons 40 1) (cons 1 bez) (cons 3 "TOP") (cons 2 "NAME") (cons 70 0) (cons 73 0) (cons 50 0) (cons 41 1) (cons 51 0) (cons 7 "STANDARD") (cons 71 0) (cons 72 0) (cons 210 (list 0 0 1)) (cons 74 0) (cons 62 256) (cons 39 0) (cons 6 "BYLAYER"))) (entmake (list (cons 0 "ENDBLK")(cons 8 "0"))) (entdel fe) (entmake (list (cons 0 "INSERT")(cons 2 bn)(cons 10 '(0 0 0))(cons 66 1) (cons 62 256) (cons 39 0) (cons 6 "BYLAYER"))) (entmake (list (cons 0

[code]....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Open Windows Folder Of Current Drawing?

Jun 5, 2013

How to create lisp which i can simply type in to the command bar so that the current drawing's filepath-folder will be automatically opened by windows explorer?

running AutoCAD 2012 / Windows 7...

View 9 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 :: Create / Insert Block In Drawing

Sep 26, 2013

take a look at this piece of my LISP-routine.

(command "_.block" pause pause ss "")

where:

ss  -  is a Selection set of some entities

In the rest of code, I don't change the values of initdia, or cmdecho, or whatever else  

I haven't sill understood them that well.The problem is the following:

When My routine executes this line, I am promted for:

1. block name - that's OK

2. insertion point - that's OK

3. then the block-command receives correctly the entities from ss-selection set - that's OK

4. then all the object dissapear! **Problem here**

The block is created... I can insert it in the drawing from the block-data base...

But is there a way to let this block stay in the drawing ? without disappearing?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select All Viewports In Drawing / Get Name Of Layout

Sep 29, 2013

I need to select all the viewports in the drawing and to make some changes with them, I'm planning to select them all with ssget command. If I do that I will have one viewport for the paperspace itself in every layout. One of my question is, how to know which viewport is the paperspace itself?

Second question is, how to get the name of layout in which one is the viewport? It is important to me that the lisp is really fast, so I'm planning to do the most of stuffs with vla commands.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Plotting All Layout Tabs

Jul 22, 2004

Any lisp file that can plot all of the layout tabs? I am looking for one that will plot to a plt file and also pdf?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get List Of Layout Tabs Without Vla Or Layoutlist Functions?

Mar 6, 2013

okay, I need a way to get a list of layout tabs without vl-, vla-, vlax, or LAYOUTLIST functions. Why?  You ask?

This is for lisp funct that will run in AcCoreConsose. Apparently the console doesn't yet support these.

Also, need a way to check Effective name of dynamic blocks without vl-, vla- or vlax- funs also.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine For Multiple Paper Space Layout Tabs

Nov 25, 2013

Any LISP routine that can create multiple paper space layout tabs and can name them incrementally. I have a template and I wanted to copy tab2 of my layout multiple times and name them incrementally. I have a code shown below that comes close to what I need it to do but it creates a "New Layout" instead of copying the tab I need it to. Please see code below:

(vl-load-com)(defun c:LAYOUT+ (/ *error* prefix i n acDoc oLayouts layoutName) (defun *error* (msg) (if acDoc (vla-endundomark acDoc) ) (cond ((not msg)) ; Normal exit ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit) ((princ (strcat "
** Error: " msg " ** "))) ; Fatal error, display it ) (princ) ) (if (and (setq prefix (getstring "
Enter layout name prefix: "))

[Code] ......

View 7 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 Block In A Specific Layout Using Function

Jan 28, 2012

I would like to insert a block in a specific layout (eg. "LAYOUT13") using the function vla-insertblock

I have already searched the web and this newsgroup but have not found the solution.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Current View Align With Current Ucs?

Jul 20, 2013

how can i know if the current view/display is align with the current ucs?

let's say i have rotate the ucs about z axis 45 degrees and make it plan now i draw some things and then i change back to world

worlducs = 1

viewdir = 0,0,1

ucsxdir = 1,0,0

ucsydir = 0,1,0

but the display is still in the ucs z 45 (ucsfollow = 0) set the view to PLAN current (now the view is aligned) but the system vars does not change.

For a plan UCS, you would need to compare the VIEWDIR system variable and the cross product of the UCSXDIR and UCSYDIR system varaibles.

[URL]

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Check Current Plotter Name For Current Tab

Sep 3, 2013

Technique that can check the current plotter name for the current tab and assign it to a variable?  i.e. can it be assigned to a variable to check if if equals "myplotter1".  The next step  - is there a technique to change the plotter name to "myplotter2.pc3".

I have partially done the latter part of this in the past using the -plot command line to ASSIGN a  new plotter but I would really like to only run the routine if it really needs to.  

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Contents - Check How Many Elements Are Same

Jul 10, 2012

I have a List with values shown

A=(0 0.1 0.1 0.1 0.2 0.2 0.3 0.3)

I have to check that how many elements are the same and which one is the first and the last in the same elements.

Like 1.0 is the number 1 element and third element the the 3rd element. how can i Manipulate is Visual Lisp.

View 9 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 :: 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 :: 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 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







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