AutoCAD Visual LISP / AutoLISP :: Select Last Created Dimension?

Apr 10, 2012

I have the following code, that for some reason the last created dimension is no being selected.  That's the first problem.  The second (and not as improtant) problem( becasue it does work), is that I'm using the "dimedit" command.  I prefer to do a swap within the dxf codes, that I treid but didn't work, so I resorted to the "dimedit" command.

(command "DIMLINEAR" pause pause pause)
(setq last_dim (entsel (entlast)))
(setq oldunits (getvar "lunits"))  (setq oldprec (getvar "luprec"))

[Code].....

View 4 Replies


ADVERTISEMENT

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 :: Opening Drawing Created By Other Software?

Jun 21, 2012

I am having trouble opening a drawing created by other software, I am using the following

(defun c:water ()
(setq acApp (vlax-get-acad-object))
(setq acDocs (vla-get-documents acApp))
(vla-open acDocs "L:/GIS_CAD/CAD NZMG/Water/Water Nov08.dwg")
)

If I try the routine I get ; error: Automation Error. Error Decrypting Data.

If I open the drawing normally (that works) and save as a dxf, then open the dxf and save it again as a dwg the routine works. I use the routine for 5 seperate drawings that get updated every month and would rather have a routine that opens the drawings without the fiddle.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Determining The Layer Block Was Created On?

Feb 21, 2012

I have blocks that were created on one layer but inserted on another layer. So, when i  turn the layer off that the blocks were inserted on they remain visible because you have to turn off the layer they were created on to have them disappear. Is there a way for me to determine what layer the blocks were created on?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Overriding A Dimension Value?

Jun 11, 2002

I am wondering how I can override a dimension value through AutoLISP. Is there a command line that I can use so that the pop up window won't show up?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Text In A Dimension

Oct 15, 2012

I want to override the measurement in a dimension with a string of text using a LISP command.

E.g.. "select dimension"

type new text for dimension

replace dimension measurement with new text. I can get the entity and its values, buy not sure which value to change for the "text override".

BTW Acad 2012.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Rectangle Dimension?

Apr 17, 2013

how I would go about writing a function that would calculate the length of a diagonal of a rectangle using SQRT function? I've been trying but so far nothing!

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dimension Styles Colors

Aug 13, 2012

Is there any way to change the colors of the dimensions styles, including dimension lines, extension lines and text to "by layer"

I found a code to change the colors, but only affects the current dimensions in the drawing and the styles do not change.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Coordinates For Dimension Arrowheads?

Jul 14, 2012

I'm writing function which will facilitate user to offset dimension. After enter command, he select dimension and select point near one of dimension's arrowheads. Then I'm calculating new XLinePoint1 or XLinePoint2 and replacing original.

I have everything done. I thought ... The problem is when user firstly create AlignedDimension and after that he create RotatedDimension by using continous function. After that XLinePoint1 and XLinePoint2 are not parallel to the DimLinePoint (look at image).

How can I get coordinates of points selected in red rectangles?

I know that one is specified as "dimension line defining point" but what about second? How can I get its coordinates?  Or maybe there is other way to get this point?

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Dimension Between Two Points In A Selection Set

Nov 1, 2011

Looking to make a selection set of points that are on a specific layer, and then create a dimension between, in this case, two points. I feel like it should be very simple, but I can't get it to work for the life of me. Here is the test code I've been playing around with:

(defun c:test (/ sel1 TC)
(setq sel1 (ssget "X" '((8 . "VPOINTS"))))
(setq TC (polar (entget (assoc 10 (ssname sel1 0))) (dtr 180.0) 9))
(command "DIMLINEAR" (entget (assoc 10 (ssname sel1 0))) (entget (assoc 10 (ssname sel1 1))) "V" (polar TC (dtr 180.0) 9) "")
[code].......

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Dimension Style To Annotative Off?

Nov 8, 2013

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

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Set Dimension Break Size

May 17, 2013

I there any way to set the dimension break size in autolisp ?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dimension Color By Layer

Oct 20, 2011

As a consultant we grey out architectural backgrounds for our sheets. We use the SetByLayer command to change the color of the objects in our sheets to gery out. The issue is with dimsensions. Dimension Line Color, Extension Line Color, and Text Color are all set at By Block as default and no one ever bothers to change it unless they are setting it to a specific color which is even more of a problem for us. You can edit the properties of an existing dimension and set Dim Line Color, Ext Line Color, and Text Color to by layer, I am looking for a way to automate this. Something that can search through a drawing, grab all the dimensions (even in blocks) and set everything by layer.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Layer State - Ignore Any Newly Created Layers?

Aug 8, 2013

we have a good size project going on with lots of view ports of a base map (floor plan or site plan).  Then we set the viewport layers the way we would like it, but along the way, we keep getting updated base maps (floor plan or site plan) with new layer created in them.  These newly created layers are for the originator and will not affect our project.

Is there a way to have our project set to ignore any newly created layer from the originator of the base files?  That is, we have our project (viewport layers) set the way we want it.  When we get an updated base file, replace the xref(s), our layer state will still be the same, ignoring any newly created layer, automatically.  I sure hope I am clear enough here.

Our problem is that when we get a new base file, then we would have to go to every file that has a viewport related to this new base file and turn off the new layers.

AutoCAD 2014

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Line Length To Dimension Override?

Sep 23, 2011

My goal is to be able to select a line and a dimension and then have the line's length appear as the text override for the dimension.  I have the code to substitute the variable "dist" for the dimension text:

(setq dimselected (entsel "
Select Dimension:"))
(setq newlength dist)
(command "dimedit" "n" newlength dimselected "")

but am having problems extracting the line's length to the variable and setting setting it equal to the variable.  To make things more interesting, the value needs to be in inches with fractional inches accurate to 1/16".

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Additional Counter For Layer Dimension

Aug 22, 2011

if my attach lisp can add sort of counter that how many dimensions, leader and multileaders have been move to layer "dimension"...

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Any Way To Extract All Dimension Text At End Into Excel

Aug 16, 2012

I'm dimensioning an old drawing with the real (measured) dimensions and with the drawing dimensions in brackets (using ' 1500 (<>)' to give '1500 (1505)' for example.

What I'd like is to also be able to put on the difference between the length I type in and the length in brackets - as this would let me see any really glaring errors that can't be attributed to user-error on the laser measure.So I could type in '1500  (<>) (X)' where X is the formula, and get ' 1500 (1505) (5)' back?

How to be able to run a script that could highlight any dimensions where the number is brackets and the typed number have a a difference of, say, 50.Or failing that, any way to extract all the dimension text at the end into excel so I can see the differences myself?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dimension Export Routine Modification?

Dec 7, 2012

Found this routine online and am hoping to modify it to my needs, just not sure how to proceed.

It exports the text out of the dims into an excel file, the issue I have is that it automatically opens a new book every time you run the lisp with the original workbook open.

I am trying to get it to automatically insert the next set of numbers on the row below the first pull.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Calculated Text To Ordinate Dimension

Aug 8, 2013

Currently, when I do drawings, I give my machinists drawings with each point, and they program their machines.  To do that, they calculate the round part diameters, which is basically 5" - 2x<Dim>.   

I'd like it if I could give them drawings with the real number, and in parenthesis next to it, 5-2x<Dim>.  

 I've attached a jpg of what I normally give them and how I'd like it to look. Is this something do-able via a macro or something?  

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Auto Dimension Closed Polyline

Mar 8, 2013

Is there a command or a lisp that will automatically dimension each side of a closed polyline at once? See attachment for image. 

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select All Viewports (LSP)?

Sep 26, 2013

I have the below code, which works great accept if the layout tab doesn't have a viewport.What am I missing?

(defun ViewportLayerUpdate ()
(setq OLDcmdecho (getvar "cmdecho"))(setvar "cmdecho" 0)(setq OLDnomutt (getvar "nomutt"))(setvar "nomutt" 1)
(if (setq ss1 (ssget "X" (list (cons 0 "VIEWPORT"))))(if (setq ss (ssget "x" '((0 . "VIEWPORT") (-4 . "/=") (69 . 1))))
 (command "CHPROP" ss1 "" "LA" "0-VPRT" "") ))
(if (setq ss1 (ssget "X" (list (cons 0 "VIEWPORT"))))(if (setq ss (ssget "x" '((0 . "VIEWPORT") (-4 . "/=") (69 . 1))))
 (command "change" "p" "" "p" "color" "bylayer" "")   ))

[code]...

Factory Design Suite Ultimate 2012
AutoCAD 2012 | Inventor Professional 2012 | Vault Professional 2012

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select All In Macro

Jun 19, 2013

Trying to add this macro to a new command in my cui. Does Select all not work in macros?

^C^Clayiso;;_select;all;;_chprop;la;c-rway-x;;

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dimension Building - Labeling Multiple Lines At Once

Sep 20, 2012

How to write an AUTOLisp program to label building dimensions.  With Civil3d 2013 preventing me from labeling multiple lines at once, creating building labels to dimension complex building exteriors is much more complicated than it needs to be. Lisp Routine that Generates a MText or Dtext dimension centered on a line and offset to be clear of the line.  the layer for this piece of text would always be "DIMS-BLDG" and the text style will always be "L50s."

the text doesn't have to be organized as it is in this example. the main focus is the layer being correct with the foot mark, precision set to xx.x and oriented to the line.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Alert To Overlap Dimension Lines?

Sep 9, 2013

Sometimes someone dimensions a floor plan and starts one direction and then "goes back " the other way over the top of the dimension they just placed, which causes the dimension lines to overlap, which in turn shows incorrect distances when viewing on paper. Any lisp routine that can alert you to the fact that there are overlapping dimension lines (not the extension lines) in a drawing by changing them to color White or something? I have pasted a routine that we use which changes all dimenions with "modified text" to color white. That way I can see if someone just typed in the dimension distance they wanted instead of what was actually there.

(defun c:dc (/ dim_length)
(setq ssmod (ssget "X" (list (cons 0 "Dimension")(cons 1 "~"))))
(if ssmod
(progn
(setq dim_length (sslength ssmod))
(command "Change" ssmod "" "P" "C" "w" "")

[Code] ......

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Double Click Dimension For DIMRND Override

Feb 13, 2013

I want to doubleclick on a dimension and have the DIMRND override appear

I can't figure out what command I need to customize the doublclick CUI

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Creating Stacked Fractions For Dimension Override

Sep 30, 2011

I wrote the code below (allow the user to pick points in different viewports and then override an existing dimension's text with the difference in X values.  The (hopefully) last issue is that the fractions should be vertically stacked and at 100% text size. 

(defun c2text ()
(command "mspace")  
(setq p1 (getpoint "Select left point "))

[Code]....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Dimension Text Fill Color To Background

Oct 28, 2013

I would like to set dimension text fill color to "background" instead of, you know, dimensioning my drawings properly.

I have this code I got on these forums and it works well except for the 'TextFillColor' variable. I can't find the correct color number or syntax for "Background'. It's currently set to 0 which produces ByBlock, and any number I put in there corresponds to the AutoCAD color number (1 = Red, 2 = Yellow, etc.)

If you have a better routine that you could post that works for me too. Or maybe you could just do my work for me? Even better.

(defun c:test (/ obj num cnt)
(vl-load-com)
(setq ss1 (ssget '((0 . "Dimension")))
num (sslength ss1)
cnt 0)

[Code]...

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Objects With Given Xdata?

Jan 2, 2012

with a function like this I added some xdata, some MULTILEADER

(defun c:add_xdata () (princ "Select: ") (setq ogg (car (entsel))) (addXdata ogg "TEST" "CODICE" "1256") (addXdata ogg "TEST" "MATERIALE" "LEGNO") (addXdata ogg "TEST" "TIPO" "A"))
 
Now with the following function can only select leaders who have linked the xdata application TEST

(setq selez_all (ssget "X" '((0 . "MULTILEADER")(-3 ("TEST")))))
 
I can not, however, find a way to select all MULTILEADER who have a particular value of XData.

For example I would select all MULTILEADER with MATERIALE = "LEGNO" and TIPO = "A".

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Arcs By With Normal Z -1

Feb 11, 2013

Newbie here trying to learn LISP. My first program is to flip all arcs and circles that have a Normal Z property of -1. But I'm having trouble finding a detailed list of commands and functions for the LISP language that explain creating circles to selecting entities filtered by properties. I must be searching for the wrong terminology.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Possible Select All ANNOTATIVE Objects In A DWG

Jun 20, 2012

is it possible select all ANNOTATIVE objects in a DWG and  to set a Viewport/ANNO scale for all  via lisp

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Color Dialog Box

Jun 21, 2013

using autolisp or visual lisp I want to open "Select Color Dialog Box" URL....and get RGB color code to my lisp.If I enter "color" in command line, i get color dialog box, but if I use this command in (command "color") I get more promts and not color Dialog Box.

I want to make a lisp routine which would ask for first color, second color and range of colors. And will calculate color range from first color to second color.

View 7 Replies View Related







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