AutoCAD Visual LISP / AutoLISP :: Appending Txt File Including Quotation Marks And Open Closed Brackets

Jun 22, 2012

Id like to append a file with the following text...
 
(load "C:/ICT/GEBERIT/LSP/GEBERIT.LSP")
 
Quotation marks and all but how do i Handel them and the open and closed brackets using the following lisp example

 (setq f(open "C:/ICT/AutoCAD_Architecture_suite_2012/LSP/acaddoc.lsp" "A"))(write-line "(load "C:/ICT/GEBERIT/LSP/GEBERIT.LSP")" f)(close f)

View 4 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Appending Associative List

Jul 17, 2012

Here is the code snippet from my program, I am trying to build a associative list from two regular lists in the while loop.  Does ""append " or "cons" only work for simple lists? Given attributeNameList attributeValTypeList which are always of the same length

(setq listCntr 0)
(while (<= listCntr (length attributeNameList))
  (setq attrTagTypeAssnList (append attrTagTypeAssnList (list ((nth listCntr attributeNameList)  (nth listCntr attributeValTypeList))) ))
  (setq listCntr (1+ listCntr)
)

How can I dynamically build the association list.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Appending Support Paths

Dec 21, 2011

I am adding tool palettes for our new CAD Standards and would like to set the support paths so the users don't have to.

I will need to set:

Support File Search Path
Dictionary
Plot Style
Color Book
Drawing Template
Sheet Set Template
Tool Palettes

[URL].......

[URL].........

[URL].........

[URL].........

[URL]...........

 Basically I would like to append the paths for the new items, but not overwrite the variety of existing paths.

So I assume I need to read the current paths, read the new paths and append them to the current paths, then write them as updated paths? This is for about 30 users in 11 different offices and varying cad skills.

I can tweak existing LISP routines, but have never written one from scratch. Is there an "easy" way to accomplish this?

View 2 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 :: Remove All Attributes Including In Nested Blocks?

Jan 8, 2013

There is a quick way to remove all attributes, including in nested blocks. Looking some lisp in the forum, I can't find one code for remove this elements completely.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Count Dynamic Block Including Total Length?

Apr 2, 2012

lisp to count dynamic block including total length.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Selected Text To Tagged Attribute Including Prefix / Suffix

Apr 5, 2013

I have very little knowledge in complex Autolist routines and routine to do the following:

I would like to be able to provide a Prefix and/or Suffix via dialog then pick any line of text or multiple lines of text and have it concentrate.  For example:  Prefix:  First Floor Suffix: M100.  I pick the room text on an arch floor plan "Mechanical room" and the second line "100"  The result will be "First Floor Mechanical room 100 M100". 

But lets take it a final step further; once condensed, I want it added to a perticular tag attribute in a block I inserted.

Example of how I would use it.  I insert a symbol for an addressable smoke detector that has several tags; one of them being Location.  I would use this routine to gather the information provided by the Arch floor plan and join it with the block attribute for exporting later for use in the Fire Alarm Panel Programming.

attached is a sample block with the attributes.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Script File To Open Multiple DWG File Not Working In 2012

Dec 22, 2011

I am trying to make a script file to open a drawing and run a lisp routine. They both work independently just fine, the script file will open the all of the files fine... and the lisp is in the startup suite and works in all the files. But when I tell the script file to open the first drawing then run the lisp it hangs trying to open the next file after running the lisp. I have Filedia set to 0, but the message I get when it goes to open the next is "No canvas exists. click New Canvas." (And on top of that... Filedia even set back to 1 still does not display the Dialog box anymore, I have to shut down AutoCAD 2012 and start again then it works.) I Have tried several ways, Opening one at a time then run lisp, and open all files first and then try to run lisp (that closes the file after running) and try and run it again in the next... It will only run the lisp one time and then locks up from there.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remember The File Open Once Or The Path?

Jul 4, 2012

like in AutoCAD there is REMEMBERFOLDERS can u tell me if i use syntax with getfiled and i want the path to be remember next time what should i do or what syntax i use for that.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Creating Two Closed Polylines From One Shape

Jan 4, 2012

I have a series of boxes or polygones that I would like the program to find the 1/2 distance and create two seperate polylines from the one object. 

Example: 

I have a square with pt1,pt2, pt3 and pt4 respectively.  After I have ran the program it would create a diagonal from pt1 to pt3 and join the rest of the lines now to create the one polyline. Also it would do the same to create another exact polygonal shape for the other half. Thus creating two shapes of equal value from one.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Counting Blocks Which Are In Closed Polyline?

Oct 19, 2011

Is there a routine that I could use to count the blocks that are in a closed polyline?  The blocks may have or not one or more attributes.

In a previous session I saw a routine which was counting the blocks which had attributes in them, but it doesn't really work, because some of the blocks dont have attributes.

Also is there a routine that counts the different texts that are in the same polyline?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Auto Dimension Closed Polyline

Mar 8, 2013

Is there a command or a lisp that will automatically dimension each side of a closed polyline at once? See attachment for image. 

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Saving Areas Of All Closed Polygon

Mar 4, 2013

I'd like to get areas from all closed loop polygons of my drawing and save them. 

From my point of view, the function would be to:

- hatch every polygon of my drawing
- for each hatch do
- extract area and put it in an array with the variables (name of polygon  and area).

And then is it possible to save it in a DWG or DXF file in order to reuse these areas by another program ?  

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Insertion Point Is Within A Closed Polyline

Oct 11, 2011

I've have code to test if the insertion point is within a closed polygon. But prior to testing the insertion point I use ssget to trim the selection set initially..

(ssget "CW" Pnt_List (list (cons 0 "INSERT")(cons 2 BlockName)))

this requires that the whole Crossing Polygon is visible, so I do a zoom first. This requires time. Is there a way I can do this that does not require the zoom?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Closed Polyline And Convert It To Region

Oct 9, 2013

I'm trying to look for a LISP command where i will create a closed polyline with 4 sides in different angles. then convert it to region. 

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract All Layers In An Open Drawing To A Notepad Or Txt File?

Mar 5, 2012

How can I extract all layers in an open drawing to a notepad or txt file?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Closed Polyline And Place Mtext With The Room Name And Area In M2

Oct 24, 2013

LSP file i downlaoded from web.it is to use for Area with (m2) and room name. by click polyline.

i want to modify it to use without adding Room Name, just insert area to the drawing.

(defun drtxt (/ rn tx ls vl lt ht lb hb nr pt)
  (setq tx (strcat "Area: "
       (rtos (/ (getvar "area") 1000000) 2 2)
       " m2"
       )         
       rn (getstring "
Room Name: ")

[code]....

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Segregate Closed Polylines In Drawing By Area Range?

Mar 21, 2013

I need to segregate closed polylines in my drawing by area range. Ideally, I would input the number of ranges I need.

Then somehow find the smallest and largest pline area to determine the range values (rounding up to a sensble number)

Then with the ranges determined the polylines would be segregated and moved to new layers.

I've been trying to hobble together pieces but with no joy.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Open File To Write On External Drive - Bad Argument Type

Jun 5, 2012

I'm trying to open a file to write to on my external drive, I get this message "bad argument type: stringp nil".

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine Required To Replace / Place Block On Each Closed Polyline?

Mar 26, 2012

Does any Lisp routine available to batch replace all the closed polylines with an existing block?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Any Other Way To Open Up Blocks

Apr 12, 2012

I have this code w/ which I can open up Block Library Blocks for editing.  We have R2012 installed w/out VBA.Our MIS department is impossible to deal with.  We have this new fangled permission hysteria so I cannot install VBA myself.Is there any other way to open up my blocks? What I can I do instead?

(defun CpL () (prompt "...Open Library Block or Xref...")(terpri)
(setq a (entsel)) (setq b (car a )) (setq c (entget b)) (setq d (assoc 2 c))
(setq e (cdr d)) (setq ff (strcat e ".dwg")) (setq PP (findfile FF))
(setq opath (strcat "acadapplication.documents.open ""PP"""))
(command "vbastmt" opath))

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Setting Workbook Already Open?

Nov 3, 2011

I need to use visual lisp to set the workbook if it is already open. What is the syntax for this?

I got the ExcelApp already set as well as the FilePath.

If the workbook is not open then this works

(setq WorkBook (vl-catch-all-apply 'vla-open (list (vlax-get-property ExcelApp "WorkBooks") FilePath)))

I want to be able to see if the workbook is already open and if so set it otherwise open it.

View 2 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 :: 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 :: Open / Change And Plot DWG

Jul 9, 2013

Is it possible to open a dwg, change something and then plot a layout with visual lisp. This is my start. Opening is working, but plotting not. I have to switch between drawings before the function is going on. Sometimes it's plotting an empty sheet and otherwise an error: ERROR: Automation Error. Description was not provided.

(defun plotbatch ()(vl-load-com)(setvar "sdi" 0);; open file(setq acadobject (vlax-get-acad-object))(setq documents (vla-get-documents acadobject))(setq open (vla-open documents "U:\testfile.dwg" :vlax-false));; changing something;; plot layout(setq plot (vla-get-plot open))(vla-put-NumberOfCopies plot 1)(setq layouts (vla-get-layouts open))(vlax-for each layouts (if (= (setq name (vla-get-name each)) "TestLayout") (progn (setq salayout (vlax-make-safearray vlax-vbString (cons 0 0))) (vlax-safearray-put-element salayout 0 name) (vla-setlayoutstoplot plot salayout) (setq errmsg (vl-catch-all-apply 'vla-PlotToDevice (list plot "\\RW-PRN01\RICOH"))) (if (vl-catch-all-error-p errmsg) (prompt (strcat "ERROR: " (vl-catch-all-error-message errmsg))) ) ) ));; close file(vla-close open :vlax-false)(princ))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Customize PDF Creation - Open PC3 Properties

Oct 23, 2013

I'm trying create a LISP to customize PDF creation.  The lisp looks into the .PC3 file which paper size better fits the plot area. But its exaustive to every time i want to create a new paper size i have to open the .pc3 file and configure a new paper.

There is a way to open the .pc3 properties through lisp?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Don't Auto Open Or Close Dialogs

May 30, 2013

Is there a way Autocad could just do what I asked for, and nothing more?A few examples

- After publishing, the publish dialog auto closes.  I don't wat that.  After publishing dwf I also want pdf.(I know you can save the list, that's not the point.  If you didn't close the dialog I wouldn't need it)

- When selecting a hatch, the ribbon automatically jumps to Hatch Editor.  I don't want that.  Maybe I just want to change the layer.  I can find the Hatch editor my self..Dito for XREFS

- I do not want any dialog giving me warnings, about anything.  

If an XREF doesn't get attached, I can see that.  I don't need a dialog telling me.If a shape file is missing, I can see that..A triangle sign above the command line is totaly adequate.Don't auto open or close dialogs, for what ever reason.

So ... don't auto do anything I can perfectly do manualy.  No doubt there are a few more examples I can't think of right now.The nice thing would be to get a variable that gives me that "no auto" mode.  

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Open Standard Drawing From Menu

Sep 4, 2012

I have a small number of drawings that I use very often. I would like to make a menu item to open a certain drawing but I keep getting stuck when the drawing name should be entered automatically.I use the code

^C^Cfiledia;0;open;"test.dwg";filedia;1;

The drawing is my support file search path and the name is unique. How do I get this to work properly?When running this command:

Command: filedia
Enter new value for FILEDIA <1>: 0
Command: open

Enter name of drawing to open <C:previous.dwg>:

*cancel*
Command: "test.dwg"
Unknown command ""TEST.DWG"".  Press F1 for help.
Command: filedia
Enter new value for FILEDIA <0>: 1

It asks what file to open and suggests the last opened file, and whatever I tried so far this keeps happening.

*.scr files are not allowed on our network, I can't create or rename files to *.scr. Of course I could ask the admins to allow this but I think our security policy is more important than me having a button to open a file.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Failed To Open Project After Load?

Aug 23, 2011

We have stored lisp in fileserver which 30 users can access it. Now a day some users have getting the ‘failed to open project’ error after load the Lisp due to this they r also not getting most of the commands. The full rights have been given to appropriate folder which contains (Autolisp application source file, .vlx, Autocad VBA source). It has working for limited users (8-10 users).

Server OS: Windows server 2008

Note: Previously we had used windows server 2003.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Put List Of Open Drawings Onto Ribbon?

Dec 3, 2012

I want to put the list of open drawings (like the window tab on the menubar has) onto the ribbon? Is this possible?

View 2 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







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