AutoCAD Visual LISP / AutoLISP :: Unable To Read Plot Settings From Variable In Text File

Sep 2, 2012

I’m trying to create a plot command that reads settings in from a variable stored in a text file but its becoming muddled up somewhere.

(defun c:MYPLOT ();Setting nessesary variables...(setq fname "C:/ICT/AutoCAD_Architecture_Suite_2012/CUSTOM/TREADSTONE/PEN/MYOUTPUTDEVICE.PEN")(if(setq f(open fname "r"))(while (setq MYOUTPUTDEVICE (read-line f))(close)))(setq fname "C:/ICT/AutoCAD_Architecture_Suite_2012/CUSTOM/TREADSTONE/PEN/MYPAPERSIZE.PEN")
[code].......

View 5 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: How To Check If System Variable Is Read Only

Nov 22, 2012

How do I check, with LISP, if a System Variable is read only? In particular ANNOTATIVEDWG. This one is read/write when there are no annotative objects in a drawing, but read-only if there are.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Print Specific Variable To Text File?

Apr 5, 2013

I'm looking for a way to find out what all plot styles are set in drawings in a sheet set.

We are transitioning from color based pen settings to style based and would like to be able to export a log that shows the variable PSTYLEMODE for each drawing in a sheet set. I plan on using ScriptPro to run it on the full sheet set.

Civil 3D 2013
Windows 7 64-bit
Xeon W3550 3.07 GHz
Nvidia Quadro 4000
12.0 GB RAM

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Append To Text File / Record Date Variable

Feb 22, 2012

how to append I’m assuming its not write-line but append line. And also I’m having trouble recording the date variable… I keep getting error bad argument type stringp nil

; Appends usage count by DATE long variable...(setq g(open "C:/ICT/AutoCAD_Architecture_suite_2012/CUSTOM/WOOD Clones/PEN/USSAGELOG.PEN" "w"))(setq MYDATE DATE)(write-line MYDATE g); AS ABSOLUTE LAST WE NEED TO CLOSE THE TEXTFILE...(close g)

I have the following code snippet I’m trying to append the file named USAGELOG.TXT to record the date of executions

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Read Excel File To Insert Text Values At Coordinates

Mar 6, 2013

I got a new work and get it done in the next 2 days, but first I need to do this... from a text file (or excel file, I got both) I got 3 columns, 1 one for node number, and 2 other for X and Y coordinates for each node.

So from that file I need to insert into autocad the node numbers as text (using the current style and height) at the point specified by the other two columns, that are the X,Y coordinates which will be the insertion point of text..

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Compare Value Of Variable To Set String Of Text

Jun 11, 2012

I would like to know how I can compare the value of a variable to a set string of text if the two prove to be equal perform task A if the two prove different perform task B?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Adding Variable To Existing File

Oct 4, 2012

I have attached 2 lisp files. datblkx5 makes a block of selection, inserts the block with a 5x distortion, explodes it, and corrects the text for width factor and text height. This one works fine.

I wanted to add the feature of scaling my selection with a user input value. This is the lisp datblkxxx. This one doesn't work. (that is it doesn't correct the text for width factor). I can't figure it out.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Display Variable Value As Text On Drawing Window

Jun 14, 2013

I am writing a LISP program to generate development of surfaces. Once the entire drawing is completed, I want that the input data to be displayed on drawing window as text.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: File Is Not Read Only / And Permission On File Appear To Be Just Fine

Aug 20, 2013

(if (findfile MyFile)
  (setq fl (open MyFile "a"))
)

the file exists however the open function still returns nil... the file is not read only, and permission on the file appear to be just fine.What other reasons would there be that cause open function to return nil?This is happening only on one machine. All the others are writing to the file just fine.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Read Lines From A File And Save To Multiple Lists?

Jul 22, 2013

I am writing a program to grab a bunch of layers from a list, check a drawing to see if the layers are on the list, and if not save to an external file. I have the second part of the program done, but I can't get the first part to work.

I am trying to open a file read the contents and save it to a list.

Here is the code I have so far, but it doesn't even get into the foreach statement.
 
(setq layerslist (list '"0list" '"detaillist" '"clearancelist" '"clearanceelist" '"doorsdrawerslist" '"hiddenlist" '"hiddenelist" '"deletelist"))(setq count 0)(foreach thislayer layerslist (setq f (open (strcat "C:\filterlists\" thislayer ".txt") "r")) (while (/= (setq text (read-line f)) nil) (setq (read thislayer) (cond ( (= 0 count) (cons (cons 8 text) (read thislayer)))( (append (read thislayer) (list (cons 8 text))) ) );cond );setq (setq count (+ count 1)) );while (close f) );foreach
 
I've also attached one of the text files. Im doing something in the wrong order, or I have something inside the wrong set of parenthesis.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Plot In A File Some Windows?

Jan 24, 2001

I need to plot in a file some windows from a LISP, like (command "-plot"...

The windows are defined in a list of points like (((0 0 0)(10 10 0))...) defining lower-left and upper-right corners. Each .plt file must be saved with a different name.

Is it possible from AutoLISP in 2000?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Plot To A File Share

Oct 3, 2012

R2012 win7

Can you plot to file using a "file share" location? i.e. \\bcnymfilp01\Parts_Labels\88881"

(vl-cmdf ".plot" "Y" "" "\\bcnymprtp01\Proto Label Printer" "Legal" "I" "Landscape" "N" "E" "Fit" "C" "Y" "monochrome.ctb" "Y" "A" "Y" "N" "Y" "\\bcnymfilp01\Parts_Labels\88881" "Y" "Y")

Everything seems to run but when it comes to the plotting, AutoCAD crashes.

Findfile works fine:

Command: (findfile "\\bcnymfilp01\Parts_Labels\50981.plt")
"\\bcnymfilp01\Parts_Labels\50981.plt"

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: File To Plot All Layers ON?

Mar 6, 2013

Lisp file to plot all layers on,

I’m not sure if there is a lisp file that cans Plot All Layers ON at a time instead of going to the long story of the layer properties manager.

Software: AutoCAD 2014, AutoCAD C3D, AutoCAD M3D, Revit
Windows 7 (Ultimate 64 bits),
Firefox 20.0,
Kaspersky 2013.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Plot A File With Block / Attribute Name

Jan 23, 2012

I would like to :

-select an attribute block in my layout viewports

- select a directory where the PDF will be saved

- select the printer

and zoo.

All my layouts will be printed. The files will be created. The filename will be the attribute name (different in each layout viexports).

[ACAD2011 CIVIL3d]

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Asterisks In Variable Name?

Nov 15, 2013

I was just looking through one of Lee Mac's tutorials and I'm curious about something.

Here's a link to the tutorial I'm talking about.

[URL]

What is the purpose of the asterisks in the following code (marked in RED):

(if (not *ans*) (setq *ans* "Alpha"))
(initget "Alpha Beta Gamma")
(setq *ans*
  (cond
    (
      (getkword
        (strcat "

[code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set TARGET Variable

Apr 23, 2013

I am trying to change the current TARGET variable to 0,0,0. If the variable is not changed is causes problems with plotting. I have the VBA that will change the TARGET variable. VBA works no problems. I am wanting to replicate in LISP because I do not want to have to convert to .NET and do not want to make sure the user has the VBA loded on thier system.  Here is what have so far.

;;;Get active viewport
(setq avp (vla-get-ActiveViewport (vla-get-ActiveDocument (vlax-get-acad-object))))
;;;Get current TARGET variable
(setq CTarget(vla-get-Target avp))

Here is the problem. Is changing or putting the vaiable.I have tried

(vla-put-Target avp (vlax-3D-point '(0.0 0.0 0.0)))

and

(vla-put-Target avp (vlax-make-variant (vlax-3D-point '(0.0 0.0 0.0))(vlax-variant-type  CTarget)))

They either error out or nil with no change. I have even tried to locate it in the Dictionaries.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Plot Transparency Option In PLOT Dialog Box

Sep 11, 2012

Where else do they keep this setting? I only have found it in Active Layout in extended dada

(entget (vlax-vla-object->ename(vla-get-activelayout (vla-get-activedocument(vlax-get-acad-object)))) '("*"))
The last pice of extended data is:
 ("PLOTTRANSPARENCY" (1071 . 0))
When i change it to 1
(setq layout(vla-get-activelayout (vla-get-activedocument(vlax-get-acad-object))))
(vla-getXdata layout "PLOTTRANSPARENCY" 'type 'data)
(vlax-safearray-fill data  '("PLOTTRANSPARENCY" 1))
(vla-setXdata layout  type data)

it stays there (extended data), but the setting in Plot dialog box doesn't change!!! And it still prints no transparency.

It takes to save the drawing and reopen it again to see the change.

The command -PLOT does not have this setting as well, so my options back to VBA or Lisp, but HOW?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Add Cadfile Plot Date And Plot Time As Attribute

Aug 30, 2012

I am aware of the plot stamp available in the Plot Dialog box, however, we are looking at ways to imbed this info in the dwg. I currently have the WD_TB with an attribute for FULLFILENAME, an attribute for PLOT DATE, and an attribute for PLOT TIME12. So I get the information on the dwg. I would like to be able to run all these attributes as a string. I have tried FULLFILENAME|PLOT DATE|PLOT TIME12 with spaces, commas, ( ), " ",  etc. and I do not know the proper syntax to get this to work. I have also tried (getenv "FULLFILENAME") or the getvar, in the title descriptions box.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Writing Elevation Text In A Cad File From Text File

Jun 27, 2012

Write the elevation text in a cad file from attached text file.

In this text file Easting Northing and Elevations are given. We have hundreds of that text files.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Get Net Volume Results Into Variable

Nov 11, 2011

There is a command in autocad that will get a Bounded Volume from a closed polyline and a volume surface (command "AeccReportSurfBoundedVolume").  It reports the results to the screen. How to get the "Net Volume" results in to a variable using Lisp? 

Maybe a lisp routine that gets information from the text screen.  That would not be ideal but I could work with that.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Subtracting List From A Variable

Sep 17, 2013

I've created a list and want to subtract all the values within it from another variable, and assign it to a new variable. How do I do it?

Basically, I ask for ground level (assigned to variable G1), and then any number of depths beneath that (assign to list LVLLIST), and I want to return the value of the bottom point. So it's all the values in LVLLIST added together and subtracted from G1. And assign it to a new variable BASE.

For example,

G1 = 650.00
LVLLIST = (1.23 23.26 0.13 50.23)
(setq BASE (- G1 LVLLLIST))

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Creating Variable Names

Nov 28, 2008

How to write some code which could create variable names like var1, var2, var3, etc. I need to do this because I have a large number to create and the actual number is variable and unknown.

Instead of manually writing a large number of line like

(setq var1 value1)
(setq var2 value2) etc

I used to be able to put 1 line in a loop to create and assign a large number of variables. I remember that it involved the use of the set (not setq) and read functions.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Program Variable Names?

Feb 28, 2012

Is there anyway to program variable names?

What I was thinking of was in a loop some times I need multiple sets of similar variables but am not sure how many sets I am going to need. I would like to be able to increment the variable names each time the loop runs.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Command Line Variable

Feb 7, 2013

Somehow, I manage to turn of one variable that display errors on command line.

For example:

(seq a 6)

suppose to return, on command line, something like:

error no function definition: SEQ

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Multileader Scale Variable

Oct 10, 2008

A2008. Is there a setvar, setenv, registry entry etc. that can be used to change the scale of Multileaders with annotative off to have the same effect that DIMSCALE has on Q leaders? I want to have a single scale-independent Multileader style and modify it on the fly along with DIMSCALE and LTSCALE. I'd use Qleader but UCS's do odd things to text position and orientation.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Passing String As Variable?

Jul 9, 2013

I would like to use a string as a variable if this is possible. I've got:

new-pl-lay (as a variable that holds layer name "UGL_PL_NEW")

first-cable (as a string that holds "new-pl-lay")

I'd like set the current layer to "UGL_PL_NEW" by using the first-cable string.

Something like:

(command "_.layer" "m" (read first-cable) "")

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert Variable To Command Name?

Mar 12, 2012

I am trying to shorten my code by using the variable as the command name. Is that possible to do?

;; instead of this(cond ((eq USER_INPUT_ANSWER "blk-cdtree-01-06")(C:blk-cdtree-01-06)) ((eq USER_INPUT_ANSWER "blk-cdtree-01-08")(C:blk-cdtree-01-08)) ((eq USER_INPUT_ANSWER "blk-cdtree-01-10")(C:blk-cdtree-01-10)) ((eq USER_INPUT_ANSWER "blk-cdtree-01-12")(C:blk-cdtree-01-12)));; do something like this(C:blk-cdtree-(substr USER_INPUT_ANSWER 11))

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Save Filename As Variable

Oct 20, 2011

how to write a lisp command, or function, that will save my newly created drawing with a file name is that is called up from a variable.

For example:

(setq filename variable)
(command "saveas" "r14" "filename")

and i would want the outcome to be:  variable.dwg, rather than filename.dwg. I have tried numerous different ways of doing this with command prompt and cant seem to get anything to stick.  Everything that works just creates a file named "filename.dwg", which is not what i want to do.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Can't Append Registry To Value Of SAVEFILEPATH Variable

Oct 2, 2012

How come I can't modify the following registry key to the SAVEFILEPATH variable?
 
(vl-registry-write "HKEY_CLASSES_ROOT\SOFTWARE\Treadstone\File Sweeper" "NETWORK_LOCATION" SAVEFILEPATH)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Update Block Attribute With Variable

Mar 8, 2013

I would like to create a lisp that does the following:

Update a titleblock attribute with a $variable.

The titleblockname is variable / not static.

The attribute is not variable / Static, DW_SCALE

The titleblock is always places on the same layer, BL$4----

The (custom)-plotscale is stored in the $var "gvpsc".

I've tried to ajust the following lisp code. But I couldn't extract the part I need.

The problem is, the code checks all the layouts and updates all the titlblocks one by one.

Truely a good code. 

The only problem is, I don't have multiple layouts and I have a variable titleblock name.

Here is to code i've tried to convert to something I could use.

(defun C:UPD-DPC () (setvar "cmdecho" 0) (setq blkname "DPC-STEMPEL");(getstring "
Enter the name of block to update: ")) (setq att1 "DW_DATE");(strcase(getstring "
Enter the name of the attribute to change: "))) (setq newatt (strcase(getstring "

[Code] ....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Replace Drive By Environment Variable?

Apr 26, 2012

I want to know if it's possible to replace a drive by an environment variable in a search path in the profile. For example:

to replace C:Program FilesAutodeskAutoCAD Mechanical 2012Acadm by %LOCAL DRIVE%Program FilesAutodeskAutoCAD Mechanical 2012Acadm. 

View 5 Replies View Related







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