AutoCAD Visual LISP / AutoLISP :: How To Make Page Setup Current And Active

Sep 9, 2011

We are using this code for Page setup. But We don,t know how to make this page setup current and active.

(defun c:pgs ()(acet-error-init(list(list"cmdecho"0"osmode" 0)T))(vl-load-com)(setvar "Tilemode" 0)(vla-Add (vla-get-PlotConfigurations (vla-get-ActiveDocument (vlax-get-acad-object))) "A1" :vlax-false)(vla-put-PageSetupOverridesTemplateFile (vla-get-files (vla-get-preferences (vlax-get-acad-object))) "A1")(setq item (vla-Item (vla-get-PlotConfigurations (vla-get-ActiveDocument
[code]........

View 3 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Routine For Page Setup

Jan 9, 2013

I found a lisp routine on the internet to change page setups on multiple layouts. The lisp worked but on some of the layouts it moved the viewport off the paper background (see attached). The layouts print fine but the only way to get the viewport back on to the background is to open the page setup and click modify, then ok and close. I tested this on a .dwg that I had saved to my computer rather than on one in  the main folder but I would like to do this to to all are maps since our IT decided to rename our printer and now all pages setups are no good.All I know about lisp is how to run one.

;; Copy current layout page setup to all layout tabs
(vl-load-com)
(defun c:CPS (/ Adoc Layts clyt)
  (setq aDoc  (vla-get-activedocument (vlax-get-acad-object))
 Layts (vla-get-layouts aDoc)
 clyt  (vla-get-activelayout aDoc)
  )
  (foreach
     itm
        (vl-remove (vla-get-name clyt) (layoutlist))
    (vla-copyfrom (vla-item Layts itm) clyt)
  )
  (princ)
)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Apply A Page Setup To All Layouts In The Drawing

Jun 13, 2013

I would like a routine that will determine if 'Page Setup A' is in the drawing and if so, apply 'Page Setup B' to all all layouts within the drawing. I would like to have it run upon drawing open in the ACAD.lsp

Basically we've changed our master page setup names, and now when a user switches to modelspace then back to paperspace the layout loses its configuration.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Apply Page Setup To Multiple Layouts?

Nov 25, 2013

Is there any way of applying a new page setup to all the layouts at once?

View 5 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 :: Testing To See If WCS Is Active?

May 20, 2012

In AutoCAD 2008 vba, how can I test if the active UCS is the WCS? ThisDrawing.activeUCS will have a null value ID and using IsNull to test for it won't work. Heaven forbid the developers return the world, if the WCS is active. 

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Geo Location And Current Sun Position

Jan 11, 2012

Where is this data stored?

Geo Location

Sun Source vector (I can see it in the "Sun & Location" Panel)

But how use this data.

In attachment you will see sample drawing with all this information.

How can I find them with lisp?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Rotating A Table To Current UCS?

Sep 12, 2012

Tables do no have a rotation angle. I can find the insert point, but there is no other point to make an angle calculation with. 

(setq objTable (vlax-ename->vla-object (car (entsel))))

(vlax-dump-object objTable T)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Bounding Box At Current UCS

Oct 16, 2013

The first rectangle is drawn from 0,0 at the World Coordinate System. There is never any trouble with the code below when the objects are drawn at the WCS. The problem is when I try to draw a bounding box around an object while in another UCS. It seems that it always draws the bounding box at the WCS instead of my UCS. I have used (trans <pointlist> 0 1) on all combinations it seems and I still cannot get it to draw the bounding box at the current UCS. 

(defun c:GetFromBoundingBox (
/
*ACAD_DOCUMENT*
mspace 
pSelectedObject
lwLeft
upLeft
lwRight
upRight
[code]...

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Registry Key For Current Profile (cprofile)

May 30, 2013

Which registry Key stores the name of the Current profile ("cprofile")?
I tried following, all reurn 'nil'

(vl-registry-read "HKEY_CURRENT_USER\Software\Autodesk\AutoCADR18.1\ACAD-9005:409\Profiles")

(vl-registry-read
"HKEY_CURRENT_USER\Software\Autodesk\AutoCADR18.1\ACAD-9005:409\Profiles\(default)")

In the registry when I double-click the key, the value is displayed. But I can't access it.

View 2 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 :: Message Not Showing In Console When Load Active Edit Window

Aug 2, 2012

I'm working with our new copy of AutoCAD 2013 and using the Visual LISP IDE to create code. I also have an AC2009 machine right next to me for other tasks. On the 2013 machine when I click the "Load Active Edit Window" button it switches to the console screen but there are no messages printed like:

$
; 37 forms loaded from #<editor "C:/LISP/My-Lisp.lsp">
_$

This of course is making it extremely difficult to debug. I have checked the environment settings and they are exactly the same on each machine. The AC2009 machine prints the messages but the AC2013 machine is just giving me a blank console screen.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Rotate Block Current Annotative Scale ONLY

Dec 6, 2011

I have the below code (from a user here on the forum) which works great for aligning text, mtext and blocks to 2 points.  For annotative entities, it respects the rotation angle for mtext and text. 

ie I have an mtext object at 1"=20' scale and at 1"=40' scale.  I run the command when the current annotative scale is 1"=40'.  The object at 40' scale has changed, but the 20' scale is unchanged.  This is working as I would like it to.

But for annotative blocks, it gets weirded out.  In the above example, the block at 40' will rotate, but so will the attributes at 20' scale.  But linework and hatching at 20' scale will be unchanged.  it looks really weird. how to get it to play nice with blocks.  Ideally, I'd like the block to be at different rotation angles in different annotative scales.

(defun C:R2P (/ ss ang edata); = Rotate objects to align with 2 Points (setq ss (ssget '((0 . "*TEXT,INSERT"))) ang (angle (getpoint "
First alignment point: ") (getpoint "
Second alignment point: ")) ) (repeat (sslength ss) (setq edata (entget (ssname ss 0))) (entmod (subst (cons 50 ang) (assoc 50 edata) edata)) (ssdel (ssname ss 0) ss) ))

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Excel Macro To Zoom To Object In Current DWG?

Jun 14, 2013

I am looking for an example excel macro to zoom to an object given the obect entities handle.

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

AutoCAD Visual LISP / AutoLISP :: How To Modify Dim Text Color In Current Dimstyle

Jun 27, 2012

How to change the dim text color in current dimstyle with a lisp routine? I want to modify current dimstyle instead of override current dimstyle, so it can change all existing dim text color under the current dimstyle.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Vlide Configure Current Window Error

Aug 17, 2011

I have a problem with  "tools/window attributes/configure current"when I try to configure current window (especialy tabulator spaces 8 -> 2) I got fatal error: unhandled access violation Writing 0x0000 Exception at cc424946h

Windows 7 (x64)

AutoCAD 2009, 2010, 2011, 2012

standalone instalation

user with administrator privileges

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Edit Code To Import Setup Of Choice

May 16, 2012

I have the following code in a toolbar button that when I click on a setup within this tool it imports that setup into my current dwg. How to edit this code so that it will continue to import the setup of choice into the new drawing..but in addition....set the new one current & delete all previous setups that were in the drawing?

^C^Cfiledia;0;^Rpsetupin;"K:/_BARONE TEMPLATE FILE-2012/BARONE_PAGE_SETUPS.dwt";filedia;1

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Retrieving Current Paper Text Height

Oct 10, 2012

I'm looking for code to retrieve the "Paper Text Height" from the current (active) "Text Style".

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Setup Height Label For Sections And Elevations

Sep 16, 2013

I'm trying to set up a height label for sections and elevations. I then want to update it with a shortcut.

I already tried it with a field that shows me the y coordinates, but it won't show me the "+-"0.00 sign,when I put it to zero level. It only writes "0.00".

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Cannoscale Applies The Current Annoscale To All Objects

Mar 31, 2013

cannoscale applies the current annoscale to all objecs...i would like to apply it to specific objects? 

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sheet Setup - Rename / Renumber Additional Field

Dec 27, 2013

How to add the sheet description field into the rename & renumber window? I ask this because during the sheet set-up process we use the sheet description often, and I would like to go from sheet to sheet without having to right click and edit every sheet.

Civil 3D x64 2012
Win 7 x64 Ultimate
I7 3820 (3.6ghz quad core with HT)
32gig RAM (Corsair XMS3 4x8g)
Intel x z79 mobo (BOXDX79TO 2011 socket)
Radeon HD 7850 2gb GDDR5

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Suppress Mtext Command Current Text Style / Prompt

Nov 3, 2011

I'm running the following string in a routing that is looping so I get dozens of these prompts. How to supress these?  Or, do i have to use to entmake?

(begin loop...
(command ".-Mtext" CSW-Tpoint "W" 0.0 (vl-filename-base (vla-get-imagefile image)) "")
);end loop

Prints to the command line..

Current text style:  "Standard"  Text height:  0.0833  Annotative:  No
Current text style:  "Standard"  Text height:  0.0833  Annotative:  No
Current text style:  "Standard"  Text height:  0.0833  Annotative:  No
Current text style:  "Standard"  Text height:  0.0833  Annotative:  No

View 3 Replies View Related

AutoCAD .NET :: Set Page Setup Current?

Feb 25, 2013

I have existing .NET code that adds page setups to drawings.  I now wanted to set the newly added page setup as "current" within the drawing. 

The "manual" way to do what I am asking is by clicking the "Set Current" button from within the Page Setup Manager dialog.  How would I do this programmatically?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Importing Page Setups

Aug 23, 2011

Any Lisp routine available out there that will import a page setup in multiple drawings in one shot and save it to the group of drawings? Kind of the way you can import a page setup in a group of drawings in Publish, but that's only temporary for that particular print job. I'm looking for something that will permanently save it to the list of drawings.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Get A List Of Page Setups From Another Unopened DWG

Aug 16, 2013

I found a function on JTBWorld named listPageSetups, which appears to be meant for listing the pagesetups that exist in an "open" dwg file (as I can get it work for the current dwg).  So,

(1) Can this function be used to list page setups in another, un-opened dwg, and, if so, how?

(2) If the answer to (1) is No, is there a LISP way to get a list of page setups from another, un-opened dwg?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Page UP/DN Control Key For Menu Accelerators?

Sep 18, 2001

I doubt there is since they aren't listed in the control keys list in the help file, but it doesn't hurt to ask. I'm trying to simulate the CTRL+PG UP/DN feature of Excel to switch between tabs. I'm might just have to 'up' and 'down' arrow keys.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Globally Changing Page Setups?

Apr 19, 2012

Once upon a time in a job far, far away I had a lisp routine that deleted the current page setups and replaced them with new ones imported from a template drawing. It's probably been a good 6-7 years since I found it the first time.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: True Coordinates Start And End Of Layout Page

Mar 28, 2012

I’m trying to create a view port, which covers my entire layout (white/ page area) using the following command
 
(command “mview” ‘(0 0 0) ‘(297.5 210 0))

However as you will note 0,0,0 is not the very edge corner of my layout (white area) and my white area is smaller then 297.5x 210mm (standard A4 landscape size)

How to obtain the exact measurements and starting coordinates to fully fill my entire layout page (white area)?

View 1 Replies View Related

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







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