AutoCAD Visual LISP / AutoLISP :: Set Printing Preferences For Default Printer

Sep 18, 2012

Is it possible, using Visual Basic.Net to set the "Printing Preferences" for the default printer?I need to change the paper size (A4, A3) and orientaion (Portrait or Landscape) before I send a file to the printer.

View 1 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: 3D Modeling Tab In Preferences?

Nov 17, 2011

Why don't all the tabs show up when I dump the preferences in AutoCAD 2012?

[quote]

Command: (vlax-dump-object acad_pref t)
; IAcadPreferences: This object specifies the current AutoCAD settings
; Property values:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 0000000140bf7198>
;   Display (RO) = #<VLA-OBJECT IAcadPreferencesDisplay 0000000026743c58>
;   Drafting (RO) = #<VLA-OBJECT IAcadPreferencesDrafting 0000000026743c50>
;   Files (RO) = #<VLA-OBJECT IAcadPreferencesFiles 0000000026743c60>
;   OpenSave (RO) = #<VLA-OBJECT IAcadPreferencesOpenSave 0000000026743c68>

[code]...

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Opening Drawings With Default Visual Style Set To 2D Wireframe

Oct 7, 2013

Is there a way to programatically set a visual style before a drawing actually opens?

We have some huge models and people seem to forget to change their visual styles back to 2D wireframe before saving and exiting drawings.  Some models will crash on some workstations when trying to open in a rendered mode.

I found a lisp with a function that looked to set viewport visual styles.  But it does not seem to be supported anymore. --> (vla-put-VisualStyle vport 1)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Pausing In A Program To Allow Printing?

Jun 13, 2013

I have a lisp program which will create a cover sheet for my electrical drawings by extracting data from the title block. Once this is done, I manually print the cover sheet.

What I would like is to create the cover sheet, have the lisp program pause, print the cover sheet, then when printing is done, quit the drawing file so the cover sheet does not remain.

I tried several approaches, but the lisp program finishes before the cover sheet prints.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Default Text For Getstring?

Nov 8, 2012

How to do a default text for getstring?  I would use initget in the following except the prefix can be any letter(s). And the problem with what I have below is it does not type the default text if nothing is entered.

(defun C:ww ()
(if tmp (= nil) (setq tmp "ABC"))
(prompt "
Enter prefix <")(princ tmp)(princ ">: ")
(setq pfix (strcase (getstring)))
(if (= pfix nil) (setq pfix tmp))
(setq tmp pfix)
(setq PT (getpoint "
Pick point: "))
(command "TEXT" "S" "Standard" "J" "M" PT "6" "0" pfix)
)

View 9 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 :: Printing Dotted Pairs To Command Line?

Oct 2, 2013

I have a list of dotted pairs and some of the entries are paired with a deeper list others contain mostly string data. the issue is that I need to print the data to the command line with a newline to seperate them. So I want the output to look like:

;from(customer (city . "Mesa")(zip . "85213")(project (scope (demo . "some description")(construction . "some description")) (cost (subtotal . "some subtotal") (total . "some total"))));tocity Mesazip 85213demo some descriptionconstruction some descriptionsubtotal some subtotaltotal some total

 I can print the entire list easily with:

(FOREACH IDX (CDR (VLAX-LDATA-GET "JobData" "LIST")) (PRINC "
") (PRINC IDX) (PRINC "
"))

 But, the issue is that when the data is a list it print it out to a single line making it very difficult to read. I tried adding another FOREACH into the loop that I had hoped would iterate through the deeper list and print those lines out in a simular fashion but I only get an "error: bad argument type: consp " and it displays the first element of my list.

I tried to evaluate the IDX and check the type, so that if it is a list then it triggers the deeper FOREACH but it seems I did it wrongly.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block At Default State

Feb 15, 2013

When scanning the BTR (Block Table Records) and encounter a "*U" block definition

how can i know if it relate to dynamic block and have it's name?

acutally my current goal is:

when insert a dynamic block at default state (no change in it's dynamic properties/actions)

it's 'Name and 'EffectiveName is equal, when set some of it's properties it turns to dynamic anonymous

with Name = "*Unn"

Can i programaticlly set the block reference to be dynamic anonymous (with out setting any of it's properties)

cause i would like to modify it's BTR (with out effecting the original BTR dynamic block) but do not want to convert it to static anonymous block.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Put Default Text On Command Line For Getstring

Jun 6, 2012

I am trying to get a default value (from global variable) put as the default for getstring command. Problem is I want it as if I had typed it into the getstring command so I can modify it if required. It is for entering filenames which only change slightly ie 1129E09LS1 ...LS2 ...XS1 etc.

Current
(setq BlkName (getstring "
Enter Civil Cad File to Import: "))
For defaults that I don't want to change I usually use this format:
(or BlkName (setq BlkName (getstring "
Enter Civil Cad File to Import: ")))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Default Formatting For Field / Object-Polyline-Area

Aug 10, 2012

I create a lot of fields that reference a polyline area and I'm constantly having to change the default formatting values. I would like it to default to an Architectural format, WITHOUT the appended "SQ. FT." (which often takes up too much space), with a precision of 0 and using a comma as the Thousands Separator.

Is there any way to set these default values?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Update Radio Button Default Values In Dialog Box?

Apr 3, 2012

Rudimentary lisp & dialog box skillls here...

I have a little dialog box with seven radio buttons and a text box that generically accomplishes what it's supposed to do. To retain the current dialog values, I use the write-lline function to store the information and then use read-line to bring that information back in for other Lisps that I use. As long as the user doesn't open the dialog, whatever options were last selected will remain in effect.

However, if the user re-opens the dialog, then whatever defaults I have initially set up in the dialog will then become active (in other words, whichever of the radio buttons I have set to "1")

My question is whether or not I can have the dialog box set up so that if a user selects an alternate radio button, that radio button will keeo it's value whether or not the dialog is opened and until and if the user changes it..

As it is now, whenever the user opens the dialog box to change, say one radio button, the user then has to change the other radio buttons if the defaults don't match the current run requirements.

Here's the dialog and the lisp:

OPTIONS : dialog {
label = "   Counter to Cad Options";          
: spacer {
height = 0.75;

[Code] ......

View 3 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 :: Continuous Dimension Lisp That Alternate Its Position

Jul 12, 2012

Is there a lisp that will allow me to do a continuous dimension, but will alternate the dimension position from low, high, low and high?  If there is no lisp already created, how to create one? 

See Continuous dimension attachment for example.

I work at a glass and glazing company and this is how we dimension mullion width and DLO. See typical window dimensioning attachment for window elevation with dimensions.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add String To Each Item In List Using Lisp

Nov 14, 2013

I have a list ("temp.dwg" "temp2.dwg") and would like to add the string "insert text here" into each item in the list resulting in ("insert text heretemp.dwg" "insert textheretemp2.dwg").  how would i go about doing that using LISP?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Write A Lisp Routine That Invoke The Mleader Command

Oct 11, 2012

I'm trying to write a lisp routine that, when I invoke the mleader command, osmode is set to "nearest" & orthomode is set off. I then would like the original settings to be returned.

attached is what I have written so far:-

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Visual Effect Settings?

Jun 20, 2013

Lisp that switches back on Selection Preview i.e. thickens and highlights lines when you hover over them?I don't know why, but they are always unticking the boxes.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Combinations In DCL?

Sep 7, 2012

Is it possible to execute a certain command based on multiple selections withinin a dcl?  for example:  two radio colums, one with selections A and B, and a second with selections 1 and 2.  is it possible to program commands based on user selections from each column?  ex: if A and 1- do a command.  A 2- do a different command, etc...

I tried :

 (action_tile "key1" "(setq A t")
 (action_tile "key2" "(setq B t")

 (action_tile "key3" "(setq 1 t)(done_dialog)")
 (action_tile "key4" "(setq 2 t)(done_dialog)")

(if
(and (a) (1)
)
(command ...

but was unsuccessful.  no matter which combination was selected, the command under all combinations would run.

View 2 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 :: Nil At The End Of Command

Jun 22, 2012

I have a routine that work fine, but I receive a nil at the end of command. How to fix that?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: 3D Point From X And Y?

Oct 9, 2013

I'm trying to find acceptable point values to feed to the vlax-3d-point function for a vla-addmtext function. With vanilla lisp I just provide the point as x y = "7/32" "2-3/8". So I assumed that I could drop a 0 in for the z like: (VLAX-3D-POINT "7/32" "2-3/8" 0).

Then I thought I was going to be tricksy and try (vlax-3D-point (getpoint)) believing that I could pick the point and get what I need to feed the function, but yet again, no deal. The command line gave me: 

node
of #<variant 8197 ...>

Nothing I can use in my code. So how do I find the point in a format that vlax-3d-point will like?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Put Point At Each End Of Arc?

Dec 19, 2011

What is the magic word for put a point at each end of an arc, the lisp I have only put a point at center of the arc.
 
(defun cAA ( / i j ss e1 e2 p1 p2 p3 points )
(if (setq i -1 ss (ssget '((0 . "ARC"))))
(progn

[Code].....

View 5 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 :: Use Of The Alt Key In A Macro

May 29, 2013

I use Spell Check regularly and I always check the entire drawing. I would like to add to the Spell macro so that when I pick Spell from the toolbar it goes past the Check Spelling window and begins checking the entire drawing.

I believe I need to  insert Alt S into my macro to select Start from the window to begin the check. Is there a character or series of characters that will represent Alt in a macro?

View 1 Replies View Related

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 :: DOS DIR Command

Oct 27, 2012

I need a program that simulate this DOS command: dir /on/b *.dwg >list.txt

it list all dwg files on current open dwg file folder and sort them and finally put them in a text file with list.txt name. something like thistype list.txt)

test1.dwg
test2.dwg
test100.dwg
test256.dwg
test1005.dwg

(sort alphabetically and logically) because of disabled DOS utility in my PC I need a pure lisp functions, I tried to wrote this program but I couldn't!!

(defun c:listMaker()
(vl-load-com)
(setq path (getvar "dwgprefix"))
(setq fn "list.txt")
[code]...

and also I need a append a string(='This Is EOF') in the last line of the "list.txt" file.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Z Value From Text

May 10, 2012

I have text objects with the same Z value and I will select as follows:

(setq sstxt (ssget '((0 . "TEXT")(8 . "APS-text"))))

How to store this value in another variable "zvalue" to apply to:

(command "change" "select text objects" "" "_p" "_e" zvalue "") ?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: What Is Dot Net Equivalent

Oct 17, 2011

the following returns true since the @ symbol tests for an alpha character.. (wcmatch "S101" "@*").What is the Dot Net equivalent?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To End Application

Jul 10, 2012

Is there a command that is the opposite of starting an application to open up a file?  Like:

(startapp "PlaySound.exe" (findfile "CuckooClock.wav"))

Instead of starting an application, how to shut all of its instances down.  Let’s say I have iTunes and/or Internet Explorer w/ a few tabs open and I can close them down without getting to the application to terminate it the usual way.

Naturally,

(endapp "iTunes.exe") doesn’t work :-))

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Can't Get While Command Right?

Apr 13, 2012

I am trying to get my original layer and lintype reinstated after the user is finished with the pline..I know Im suppose to use the while command but am now completely lost on which way to do this

(DEFUN c:TEST1 ()(if (not (tblsearch "LTYPE" "MYWC")) (command "-linetype" "LOAD" "MYWC" "C:/COUNTER.LIN" ""));SECOND PROGRAM...;CREATE CORESPONDING LAYER...(command "._Layer" "Make" "WC LEIDING" "Ltype" "Continuous" "" "Color" "211" "" "")(SETQ MYOLDCELTYPE (GETVAR "CELTYPE"))(SETVAR "CELTYPE" "MYWC")(while (PROGN(COMMAND "pline")(SETVAR "CELTYPE" MYOLDCELTYPE)))

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Z Value For Points?

Jan 5, 2012

I have a drawing that has 2D pipeline (only x and y, z value =0) and 3 topo contour lines ( with x, y and z vaules). I need to divide the the 2D pipeline into say 2000 points and then get the corresponding z values from the topo contour lines. I think it can be done by interpolating between the z values for the two apparent intersection points of the 2D line and the contour lines, the x and y values will be the same for the points that falls between these two aparent intersections. Is there any lisp out there that can do that.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Pline Dimensioning

Sep 2, 2005

I am looking for an AutoLISP routine, which gives all aligned dimensions of a closed polyline, drawn in 3d.

I have attached a 2D drawing for reference.

View 9 Replies View Related







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