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.
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:
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.
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) ))
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
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?
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
[Code].....
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.
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.
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?
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.
Any Lisp Routine to scale text objects a certain value and have the program actually scale each text object as you pick them.
The change text height using the Properties function does not work for what I need because the objects I need to scale are Mtext objects with Background Mask, and when you use the Properties function to change their text height it messes up the background mask so that you have to select each text entity and stretch the mask area smaller or larger, but if you use the scale function it scales the background mask as well so the background mask coverage is still the same.
I had been trying to insert a title block (block) in to a drawing as part of changing the title block But in some drawings the block gets scaled off. Is there any system variable or any solution to maintain the drawing without getting scaled while inserting block.
I had used -dwg units and this appears to single drawings only. Any other way to do this to all the files in a folder.
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.
The crux of the matter is that the CANNOSCALE value needs to match an existing named scale. This lisp is part of a bigger lisp and I need to pass a variable into it. Here's what I have:
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"?
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.
How to change the Scale Uniformly property in dynamic blocks accross hundreds of drawings using either/or scripts, lisp, vba or anything else that might do the job.
I just need to open the drawing and select the block (one block per drawing) then edit the scale uniformly property within the block, save then close the drawing and move onto the next drawing.
Is there a way to modify the DEFAULT SCALE LIST to show a metric scale list in an imperial template? I mean, I start a drawing using the imperial template, but i want to use the standard metric scales on paper space. on previous versions the scale list shown both imperial & metric. Now it depends of what the template is using.
I created a associative and annotative hatch for a group of objects. It displays fine and the area measures fine. When I switch the annotative scale in the lower right for the whole drawing, portions of the hatch dissapear from the boundary objects - both visually and from the area in properties, When I switch back to original annotative scale, that area is still no longer there. In essense, parts of the hatch get deleted.
I have a drawing with several layouts, and in one particular layout only, I want the text to be smaller than the annotation scale would dictate (the viewport is 1"=300', but I want the text to display at 1"=50' annotation scale).
I tried selecting the viewport and changing the "annotation scale" property to 1"=50', then the "standard scale" property to 1"=300'.
Strangely, this seems to work for a bunch of MText objects I have in the drawing, but it won't work for an alignment station label group or for a particular linetype...for some reason, those two things insist on having their annotation scale equal to the viewport scale.
I tried messing around with the alignment station label group's style but couldn't figure anything out. As far as the line/linetype, I'm completely at a loss why that one wouldn't change.
I am trying to create a lisp routine, that will check the dimension style "standard" to see if its annotative. If it is, I need it to turn annotative to off.
ITO - Application Management Factory Design Suite Ultimate 2012 AutoCAD 2012 | Inventor Professional 2012 | Vault Professional 2012
I am running Autocad arch 2011 (as Autocad 2011) and a co worker is using Autocad electrical 2012 and when he works in a drawing of mine the every annotative scale that is used in the file is attached to every annotative object. Which means I have to go through every object and delete scales that should be be there....all my annotative objects appear in every view port because every annotative object has every scale..
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?
When I open a new drawing in my AutoCAD 2013 that I just recently installed last week, I encounter a problem that I am not familiar with from previus versions of AutoCAD I have worked on. First of all, the units default to decimal, and I want them to default to architectural, with feet and inches. I have to type UNITS in the command line every time I open a new drawing in order to adjust this. I have AutoCAD for Architecture 2012 on another computer, and the program automatically defaults to architectural units upon opening up. Just to let you know, the program I am having this difficulty with is part of a package called Autodesk Building Design Suite 2013. I was under the impression that it included AutoCAd for Architecture, but I think it has only standard AutoCAD.
The scale of the objects I draw vs. the scale of the drawing field is very out of proportion. What I mean is, when I open a new drawing and draw a 30' -0" line, the line appears so long on the screen that I cannot see the whole object, even if I zoom out to the maximum. I should be able to see the object in it's entirety. In fact, when I draw a line that is only 12" long, even when the zoom is all the way out, the line looks huge in length. I have tried adjusting the units to the architectural/inches setting of course, and I have tried adjusting the scale in model space from 1:1 to 1/4'=1'-0", but nothing is working.