AutoCAD Visual LISP / AutoLISP :: Setting Option For 1"-30' Viewport Scale

Oct 18, 2013

calculation a viewport scale of 1"=30'.

I've looked around and only find nearly what I looking for. For 1"=20' I have a value of 0.004167 Paper Units = 1 Drawing Units, but what is the formula to calculate 1/30"=1'-0"?

View 7 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: How To Get Viewport Scale

Feb 2, 2012

I am adapting a routine by Alan J Thompson found here for placing an outline of a paperspace viewport in modelspace.

I have added some lines for making a suitable No plot layer with appropriate linetype, and wanted to make the lwpolyline have a thickness dependent upon the viewport scale.

My paperspace viewport scales are set for printing via Zoom - 1/50XP for example to get a 1:50 scale plot (or 0.02XP)

Having selected the relevant viewport, I wanted to be able to determine the vp scale, but am unsure how to extract this information from the viewport entity itself.

The routine was as follows:-

(defun xpfact ()
(- (car (trans '(1 0 0) 2 3))
(car (trans '(0 0 0) 2 3))
)
)
--

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Setting A Custom Scale On Viewports

Aug 29, 2012

I have a problem that I cannot seem to solve.  I have a drawings with a whole bunch of layout tabs that have a few viewports in each tab. One of these viewports on each layout tab is on the layer VIEWPORT. I did this so it would be easy to filter out the other viewports in the drawings. I am using the code below to change all of the viewports with the layer VIEWPORT to the Custom Scale 0.020833. This works for all of the layout tabs except the first tab. It will not for some odd reason work on the fist tab. 

(setq vieportfilter (list (cons 0 "VIEWPORT")))
(setq ssetvp (ssget "x" vieportfilter))
(setq cntrp 0)
(while (< cntrp (sslength ssetvp))
[code]..........               

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Polygon Viewport At Specific Scale

Apr 25, 2013

I'd like to run one command that allows the user to draw a polygon viewport then sets that VP to 1/8"=1'-0".

It can be nearly accomplished with a macro, but falls just short because the polygon vp requires an unknown number of clicks, so there is no way to know how many pauses for user input in the macro.

View 6 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 :: Quicker Alternative Changing Annotative Scale In Object Scale List

Apr 10, 2013

I would like to find a lisp that changes the scale of something that has an annotative scale and deletes all other scales in the object scale list.  Often i have many different scales of existing dimensions or objects. i waste a lot of time opening the annotation object scale dialogue box, selecting add, finding my scale and deleting the old scale. 

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Regen Viewport

Jan 2, 2000

I'm trying to regen a viewport with Visual Lisp, with this code

(setq acadobject (vlax-get-acad-object))
(setq activedocument (vla-get-activedocument acadobject))

when I issue the next code

(vla-regen activedocument acActiveViewport )

I get the following error

*** ERROR: AutoCAD: AutoCAD is currently busy.

What is missing in my code?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: No Save Option

Apr 26, 2012

I am new autolisp user (i use autocad civil 3D 2012), i try to coding there but it doesn't have "save" option. How to save the file i've made?

View 1 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 :: Setting A Previous Selection To Nil?

Jan 12, 2012

How to Set a previous selection to nil from say a move command? 

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Setting System Variables

Feb 23, 2012

a simple lisp file?

I want to set "hideprecision" to 1. This variable can not be saved - I looked it up in Express Tools.

So I thought a lisp file to load at start up would do the trick.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Setting Trusted Paths

Oct 15, 2013

I can use for startups on new work stations. It will set all our custom search, toolpalette, and plotter paths and I have it working pretty well. My last hurdle is to add a trusted path to the environment to avoid users having to ok the startup lisp.

Here is a piece of the *file* is set further up in the code. It works line by line but evidently "vla-put-trustedpaths" is not legit. How can I get the additional trusted path written in to the environment?

(setq trstpath "");initialize
(setq trstpath (strcat trstpath (getvar "TRUSTEDPATHS")))
(setq trstpath (strcat trstpath ";\\CAMERONFS1\AutoDesk\ACAD SUPPORT\C3D2014 Support\LISP;"))
(setenv "trustedpaths" trstpath)
(vla-put-trustedpaths *files* trstpath) 

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Auto Constrain Setting?

Jul 12, 2013

Is there a way to set the Auto Constrain setting using lisp. I would like to be able to run a quick constrain all and then delete all constrains to fix gaps in geometry. However I only want to use the coincident, Vertical and horizontal.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: CANNOSCALE / SCALELISTEDIT Creating And Setting?

May 6, 2007

I would like to be able to check if an Annotation Scale already exists and if it doesn't I would like to create it using the SCALELISTEDIT command and then set it to be the curent scale. I then plan to invoke the MLEADER command.

I do not want to have to rely on adding every possible scale in the list beforehand as my program would fall appart when a user decides to set an unusual scale I haven't thought of adding to the list.

See my initial start of the program.

(defun C:MLD ()
(command "cannoscale" "1:55") ;STOPS HERE WHEN 1:55 DOES NOT EXIST
(setq IfAnnoScaleExists (getvar "CANNOSCALE"))
(command "-scalelistedit" "add" "1:55" "1:55" "e")
)

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Setting Dynamic Block Visibility?

Aug 17, 2011

Attached is a lisp that reads an attribute block value and uses that value to set a named view. The attribute block is a diesel expression field which reads the drawing number, so it changes as the drawing is saved to a new number. I use it when I am preparing road alignment drawings. I prepare the first drawing in the set, saving views for all drawings and when I'm done I copy that drawing 001 as many time as I need, rename them drawing 002, drawing 003 etc. and use the attached lisp with scriptpro to set all my saved views.

I also have a dynamic block called "key" in the drawing with visibility states matching the named views.

either expand this lisp or create a new lisp to set the visibility using the "VN" variable.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Field Update Customscale Viewport

Feb 22, 2013

I'm trying to create a field in a block (titleblock) that will automaticly update when I change the viewportscale.It's mostly only 1 viewport, sometimes a second of even 3rd but, they are not important to the titleblock.

I've read aboud fields and diesel expressions. I've tried and it works. there is only 1 problem,It only works with the object (when field expresssion, object, custom scale) in this case the viewport pressent at that time. 

When i use the same field with the same expressions, it does not recognize the viewport/object.Is there a way to make the field, diesel expression or even something else, work without it's need for a

object name. Perhabs that the expression gets the viewportname from a lisp, something like: (setq ss(ssget "X")) ;some thing like this Can it be done?

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find One Of Corners Of Viewport Outline

Feb 2, 2012

Further to my earlier topic for getting the viewport scale which has been nicely solved, I am looking for a way to get one of the corners of the viewport outline 'drawn' in modelspace so that I can add the name of the spcific layout Tab to which it relates in a location that suits the drawn outline.

The code that I am adapting came from the thread titled Outline projection all viewports to model..The routine appears to pick up the corners of the viewport in paperspace and tranform/translate them to modelspace co-ordinates.

  (defun _trans (p) (cons 10 (PCS2WCS p ent))) (defun _cornersFromBBox (o / a b) (vla-getboundingbox o 'a 'b) (setq a (_trans (vlax-safearray->list a)) b (_trans (vlax-safearray->list b)) ) (list a (list (car a) (cadr a) (caddr b)) b (list (car b) (cadr b) (caddr a))) ) (if (setq ss (ssget '((0 . "VIEWPORT"))))
[code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Check To See If VIEWPORT Entities Are In Selection Set?

Nov 19, 2013

I have redined AutoCAD's copy command alias to C, but to also do other things, like set a few important variables in the background.  One of the lisps I've incororated are making new viewports, that also create layers that are visibly specific to the viewport being created.

We were tasked a while ago to do an easy job of copying entities (dimensions, text and what not) in a layout.  The problem is, users are copying the viewports too, which is bit more ineffificent than using the create viewport command I developed.

Is there a way to see if a selection set includes (0 . "VIEWPORT") entities?  If the check returns nil, well then all is good.  If the check returns "true", then I can prompt the user that a "VIEWPORT" entity is selected.  I can then exit the command, or ask the user if they are sure they want to copy the "VIEWPORT" entity.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert New Border - Create Viewport

Jul 8, 2011

I have a series of drawings that are currently in modelspace. What I have to do is

1) Insert a new border in paperspace.
2) create a viewport and place the view in modelspace into it.

I am trying to use the command -vports but get an SPPROCESSQUEUE error wghen I use lists such as this:

(command -vports (list 0.625 23.59375) "" (list 35.4375 2.625) "")

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Undo Option Like In The Line Command

Dec 11, 2012

in this command how would you put the Undo option on there erase the last line and if you want to keep eraseing the lines

(defun c:gls ();keeps drawing guide lines at any angle
(setq an (getangle "
Pick an Angle:"))
(foreach pt '(a)
(while (set pt (getpoint "

[Code] .....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: C Copy Command Has No Mode Option

Dec 19, 2013

I'm trying to set my default for the 'c' copy command to be multiple in AutoCAD 2014. I set 'c' under aliasedit to COPY, but when I use the command 'c' it brings up [Displacement Multiple] as options but no mOde. If I use the command 'co' it brings up [Displacement mOde]. How do I set my 'c' copy command to default to multiple?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Pick A Command Line Option In LSP

Nov 18, 2013

I like that Autodesk now allows us to just pick a command's option from the command line instead of typing a letter in the option. For example, when drawing a rectangle we're prompted to "Specify first corner point or [Chamfer Elecation Fillet Thickness Width]" and if we wanted to draw fillets on the rectangle we can simply PICK that option from the prompt in the command line OR enter an "F" and return.

Is there a way we can use this functionality in our custom programs?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Pause For User To Activate A Viewport Before Continuing

Dec 4, 2013

I have situation where a block is inserted in paperspace before a leader is to be added into modelspace. I need it to work like the "CHSPACE" command - it pauses and asks the user to activate a viewport before continuing.

How that pause until viewport is active is done?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: File To Thaw All Layers Frozen In Viewport

Mar 6, 2013

Lisp file to thaw all layers frozen in the viewport,I’m wondering if there is a lisp file that can thaw all layers frozen in the viewport.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Annotation Scale To 1:2

Apr 26, 2013

take a look at the test.dwg it contains a block named 'box' (which is a rectangle) and some attributes. the annotation scale is 1:1 and i zoomed in to focus on one attribute.

change the annotation scale to 1:2 and you will see the attribute grows by 2 - that's ok! now load attmod.lsp and run attmod command and you will see the attribute grows again by 2

even the command only (entmod) the attributes without making any change.(to restore it use battman sync)Is there a workaround to this bug?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Scale Multiple 3D Polylines

Feb 7, 2013

Is there a way or a lisp to scale multiple 3d polylines, at same time, and the base point is the start point of each one?

View 4 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 :: Set All Lines And Plines Scale To 1

Jul 15, 2013

I am working on a script.  I need to select all lines and polylines and set there linetype scale to 1. 

I'd take a simple lisp routine if that would be easier.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Annotative Drawing Scale

Apr 26, 2012

I am attempting to create an AutoLISP that removes all un-used drawing scales from a file, then adds the standard scales used in civil engineering. This is what I tried using:

;;;Add Engineering Scales
(defun C:AES ()
 (command ".CANNOSCALE"
   "1" = 1'"
 (command "-scalelistedit"
[code]...

Now, I am only a beginner to writing LISP, but I know that my problem is that it is reading the inch marks after the one in the scale name as a enter, but I don't know how to get around this. Also, I don't know how to get it to skip scales that are still in the drawing.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Setting Support File Search Paths In Routine?

Nov 8, 2013

I have a simple lisp routine that loads everytime one of my users opens a new drawing, It sets the printer paths, sets the template paths and sets a bunch of environment variables

One thing I would like to add to this lisp routine is the ability to add support file search paths.

Is there a simple setenv variable for this? or is it more complicated?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Mleader Style - Arrow Head Size Setting

Nov 17, 2009

I have some working code that sets the Text Style name to ROMANS inside my Mleader Style called ARROW. Here it is:

(setq dict (dictsearch (namedobjdict) "ACAD_MLEADERSTYLE") ; start setq q
dict1 (member (cons 3 "Arrow") dict) ; code 3 is Mleader Style Description
el1 (entget (cdr (assoc 350 dict1))) ; code 350 is dictionary entity handle
er (tblobjname "style" "Romans") ; new value for MLEADER Text Style
) ; end set
(entmod (subst (cons 342 er) (assoc 342 el1) el1)) ; code 342 is MmTextStyleId - write new vale to mTextStyleId

I want to modify this code so that it sets the Arrow Head Size to a specific value, say 0.125. Having a tough time figuring out the DXF codes and tblobjname to do this.

View 1 Replies View Related







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