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 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 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 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 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 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.
Is there any trick that bring in an annotative block into a drawing at the annotative scale you are working in, not the scale the block was created in?
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 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.
I have a dwg with 40 blocks that have a non-annotative property. I can go through 1 by 1 and change the property to annotative and redefine the block. Is it possible to automate this? I have done some google searches but have not found anything I am able to cut and paste or put together to get it to work.
Civil 3D 2012 SP4.0 Windows 7 Enterprise 64-bit C3D 2014 SP1 Dell M6600, Core i7 @ 2.3GHz, 16 GB ram Dell T3500 workstation, too much ram to post
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.
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.
I am working on a lisp that automaticaly draws some tubes and fittings.First the user has to select the block where the tubes start and then he selects where the tubes has to end.Herefor i whrote this lisp..
Is it posible to show the user how the tubes gow befor chozing the second point?(A litle bit like when you stretch a dynamic block where you can see how the object will look like while preforming the stretch action).