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


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 :: 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 :: Automating Changes To Title Block Date Attribute?

Jul 18, 2011

I'm using Autocrat 2004.

I have a attributed titleblock. Sometime in the future I will need to change the date attribute to another value, i.e.. 7-11 to 9-11.

I can't place a text string in the title block because this title block is used for multiple drawings and the date will be different for different sets. I can't have numerous title blocks because of the client's requirements.


Is there a way to write a script to open a drawing, look for the specific attribute, change the date value, save and close the drawing - across multiple sheets? Would a lisp routine called by the script be able to do this? Or a script file called by the original script file? CAn you even use a script file in this manner?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Plot A0 Or A0+ Onto Several A3?

Mar 20, 2013

Is it possible to create a lips that does the following:

- In the Modelspace

- Get 2 points to create a plot window / give two points. (get point 1, get point 2, list points)

- Divide the window into A3 size windows

- plot scale 1:100 / prompts to ask

- Plot / Print the A3 size windows with the given / preset configuration(s)

- Perhaps even add a number to each page.

In other words, Plot / Print a A2, A1, A0 or bigger onto several A3 pages.

Depending on how big the page is, number of A3 pages, plotscale 1:100

Or asks what plot scale I want to use.The only thing I think I will need is something like:

Get point 1, get point 2, List the points. So I can set the window.

View 8 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")

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Change Plot Style

Feb 21, 2001

Is there a way for me to change a layers plot style from one to another with LISP?

We use named plot styles, STB's not CTB's.

I want to be able to create an icon that will change all layers with the plotstyle "normal" to "black". Is this possible with lisp?

View 6 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 :: 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 :: Display Plot Styles In 2012

Mar 18, 2013

Attached LISP will toggle the 'Display Plot Styles' for all layout tabs or the current layout tab.  In 2010 it would not affect model space. 

With 2012, AutoCAD added 'Display Plot Styles' as an option on the model space tab.  This routine now affects that tab. 

How to make it not change this setting for the model space tab?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Default Plot Stamp

Mar 20, 2013

Right now I have a few lines in the ACADDOC.lsp file to set up the plot stamp for all users. I would like to just turn on the plot stamp and auto load a custom .pss file that I have set up.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Plot Style Table?

Oct 3, 2012

Is it possible to create a lisp that would change the plot style table?  I don't know of any variable to type to change that.  We convert drawings from Solid works to AutoCad and use the basic monochrome plot style.  I'd like to easily change that since the act of doing that is repeated many times.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Custom Plot From Windows Explorer

Jan 27, 2012

Goal: using the native windows explorer, Open the folder containing the the multitude of drawings from different vendors and customers, usually 30 -40 .dwg files.

Highlight all the files, Right click print.behind the scenes without any further clicking or involvement from the user autocad plots the extents of model space of all the drawings to a designated plotter fit to 11x17 sheets. 

Acad 2012
Win 7

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Attribute Height Is Changing Each Time Routine Is Run With An Annotative Block

Apr 30, 2012

I only do programming when absolutely needed so it usually only happens every couple years. I wrote this routine to count nested blocks inside of dynamic blocks to count parking spaces. The routine worked fine but was relying on the ltscale to scale a block containing an attribute for the total number of spaces. I want to update the routine to use an annotative block so the scale doesn't have to be set. I changed my block containing the attribute but now when I run my routine, the attribute height gets changed each time the routine is run. The text just gets larger and larger. Here is the portion of the routine where the attribute info is gathered and updated with the new value for that attribute. If you need the entire routine, I can post it with a slight modification so it will work outside our network.

(defun updateattrib ()
(setq CNT 0) ; sets count to 0
(while (< CNT (sslength ss)) ; starts loop while CNT is less than the number of objects in the group


I am running this in Civil 3D 2010 but will want it to work in 2013 so if the solution will only work in 2013, that is fine with me.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Model Space To Display As Plot Style?

Jun 28, 2012

Is there a way to get model space to "display plot styles" through a lisp routine or a script?

i'm currently setting up a whole bunch of custom tool palettes for the company I work for and instead of the icons displaying in their actual colour (at the moment they're green, which doesn't show up very well on the light grey background), I'd rather they show in the plotstyle assigned to the individual dwg's.

call up the page setup manager (while in model space) and click modify, you can then check the radio button to "display plot styles" in the top-right corner. But when you have around 100 - 200 blocks to change, that process can be rather time consuming and cumbersome!

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Plot Stamp Shows Temp Folder When Publishing?

Jan 2, 2014

We used a block which contains deisel expressions for our plot stamp. When we publish through the sheet set manager it shows a temp folder where the drawings are spooled to instead of the actual drawing saved path. We can fix this buy turning off background plotting when we publish, but I was wondering if there is a way to show the saved path instead of the spoolled path when publishing in the background.

Below is the expression found in our plot stamp block.
$(GETVAR, "dwgprefix")$(getvar, "dwgname")$(edtime, 0, M/DD/YYYY H:MM:SS AM/PM), $(getvar, loginname)

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

View 4 Replies View Related

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")

View 5 Replies View Related

AutoCAD Inventor :: Plot Stamp Time / Date And File Location?

Jul 15, 2013

how to add the plot stamp time/date and file location when printing  in autodesk inventor the same as in Autodesk.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Plot Scale By Annotation Scale?

Aug 9, 2012

I am working on automating page setups in model space and am looking for a way to set the plot scale equal to the annotation scale for scaled drawings with

(setvar "filedia" 0)

(setq a (getstring (getvar "cannoscale")))

(command "-plot" "YES" "MODEL" "" "" "" "" "" "" !A "" "" "" "" "" "" "_Y" "_N")

Setting the plot scale with !A causes the lisp to fail.  However, when running each prompt through the command line individually, !A works fine.  what is missing?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Transfer Attribute Block Values To Another Attribute Blocks

Jul 3, 2012

I wanna transfer my attribute block values to another attribute text blocks , is there any lisp for that?

Is there a possibility for sum tag values of choice attribute blocks to inside of another attribute text block ?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert Attribute Tag Into Attribute Value?

Dec 8, 2011

Background: Someone exploded an attribute block and copied it hundreds of times throughout a project, each time changing the Attribute Tag to match the Value they expected to appear in their drawing.  The drawing must be xrefed, so the attribute definitions do not appear.

(There is only 1 attribute in the block.) 

Proposed Solutions:

1:AutoLISP routine which copies Tag data from Attribute Definition into Value of Attribute Block:

Prompt-Select Attribute Definition

Copy Tag data

Prompt-Select Attribute Block

Paste data into Value

(Allow repeat to speed workflow)(*PREFERRED*)

2:AutoLISP routine which copies Tag data from Attribute Definition into Default Value and creates a new Block:

Prompt-Select Attribute Definition

Copy Tag data

Paste data into Default Value

Create New Block

(Select Multiple Objects)(Creates tons of new blocks which are messy)

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Retrieve Today Date

Jul 17, 2012

How can i Retrieve today date through Lisp.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Expire Date For A Function

Nov 27, 2012

I want to define en expiration date in registry, after that date the some LISP programs does not allow to run. I think that suitable commands are SetEnv and GetEnv.

define a ExpDt variable that contains Expiry Date as a string. And add some statements inside of the LISP program to call this variable and check it with today's date.

I should define once time in autocad:

(setenv "expdt" "130101"); YYMMDD date for validation period (2013.01.01)

and check this every time that a lisp program should be execeute:

(getenv "expdt") ; if today's date(with YYMMDD format) ">" expdt then lisp program doen not allow to run and should be halted.

for e.g. on 2013.02.28: "130228" > "130101" ==> so the lisp function should be halted and will not work!

(without any alert or message)

a sample list function: (how can implement on this lisp function?)

(defun c:3()
(setq w t)
(while w
(setq a (getpoint "
pick point:"))
(setq p1 (list (- (car a) 0.5)(- (cadr a) 0.5)))
(setq p2 (list (+(car a) 0.5)(+(cadr a) 0.5)))
(command "erase" "w" p1 p2 "")
(command "INSERT" "*3" a "" "" "0")
(if (= a nil)(setq w nil))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Attribute Value

Jun 3, 2013

I am trying to find a lisp that would get an attribute value (tag name = NBR_5) . I'm trying to run a simple routine that would let the user place the value from the titleblock attribute as text on a drawing. I see a ton of articles regarding getting attributes but I am not well versed in programming.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get The Value Of Attribute

Dec 30, 2011

Is there a quick way of getting the value of an attribute?

I have an attributed block called "tp_attributes" and it has and attribute called "OrderNum".

I just want to be able to quickly grab that value.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Check Block Attribute Then Change Different Attribute In Block

Aug 31, 2012

select all blocks on certain layers in a drawing, check attribute CIRCUIT in each block if it starts with MS then attribute CONTROL = switched. I hope thats clear enough the way

(defun c:control()
(Setq sc (ssget "X" '((0 . "INSERT")


View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Up-to-date Offset Command - Line Prompts

Jun 7, 2012

I posted a version of the Offset command that lets you Undo individual Offsets and change the offset distance/Through option, without getting out of the command, at Cadalyst CAD Tips: URL....

It's an upgraded version of an earlier concept by Gopal Ramesh.  It's been downloaded almost three times every day since it went up, so I guess people expect it will be useful.

But the website's description includes: "this routine does not provide access to the Layer or Erase options of the built-in Offset command."  The reason for that is that I'm working back in 2004, so those options are not present for me to emulate.  [The Undo option in the routine is one that was added in some later version, but is a very useful enhancement for people using older versions, like me.]

I do also have an Offset-to-any-Layer [not just the source's or the current Layer] routine posted there: URL....

And I have a simple little routine to Offset something and Erase the source object.  So I think I have all the "pieces" to include those options that newer versions have, but that I don't.  I would like to combine the functionalities into the Offset-with-running-options routine.  That way, if people want to use it to redefine the Offset command as I have done, in order to get the while-running distance change option, those working in newer versions won't be losing the Erase and Layer options in the process, and those in older versions will be gaining yet more options.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sum Of Attribute Values

Jul 29, 2005

Say I have a block that contains two attributes, one contains a value that is a number and another contains a value that is letters. I have many of these blocks placed in a drawing, could you create a lisp that would return the sum of the number value and return it to the command line along with the letter value. Something like this:

128 RP
389 TD1
2389 SP4

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Get Attribute Value From Block

Jun 17, 2013

I continue with my problems.....

I get attribute value from block and put it in a list:

(repeat (setq cnt (sslength sset))
      (setq attValue (GetAttributeValue (ssname sset i) "tag1"))
       (setq attValue2 (GetAttributeValue (ssname sset i) "tag2"))


When I try to put them in a table...

 (foreach item lst
        (vla-setText mytable
                     row 0
                      (last item)
        (setq row (1+ row))

only put  one ( attValue2) at column, and i like  put 2 values, each one in a column in the same row

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Copy One Attribute Value?

Nov 2, 2012

i want to select a block and the lisp copies TAG1 into my clipboard (i want to paste it in excel)

View 9 Replies View Related

Copyrights 2005-15, All rights reserved