AutoCAD Visual LISP / AutoLISP :: Calculate Perimeter Of Drawing - Circle Not Recognized
Nov 22, 2011
I´m triyng to do a autolisp routine to calculate the perimeter of a drawing with several entities like arc, polyline, spline, lines and circles.
In the web i found out a autolisp routine that calculate this but it doesnt recognizes circles.
I need that the circles can be recognized, does some one knows how i can do that?
View 6 Replies
ADVERTISEMENT
Dec 19, 2013
create a routine to list all the dyanmic blocks in my drawing with a specific visibilty parameter name. The problem with the blocks that I'm trying to search for in my draiwng is that the visibility names are very similar with the only differences being CASE sensitivity (ie. OBJECT vs. Object).
(defun c:test (/ BNAME DATA E I PNAME SS VIS) (if (setq data nil vis (getstring T "
Enter the Visibility Parameter Name: ") ss (ssget"_X"(list (cons 0 "INSERT") (cons 2 "`*U*")) ) ) ;; setq (progn (repeat (setq i (sslength ss))(cond ((and (setq bname(vla-get-EffectiveName (setqe (vlax-ename->vla-object (ssname ss (setq i (1- i)) ) ) )) ) (setq Pname(car (vl-remove-if-not '(lambda(j) (eq (strcase (vla-get-PropertyName j)) (strcase vis) )) (vlax-invoke e 'GetDynamicBlockProperties) )) ) (not (member bname data)) ) (setq data (cons bname data)) (foreach itm data (print itm)) ));; cond );; repeat );; progn );; if (if (null data) (princ "
Block/Parameter Name not found")) (princ))
View 9 Replies
View Related
Apr 10, 2002
I have about 30 profiles with water pipe lines that I need to measure all their vertical angles. since the vetical scale is exaggerated so I can't use the acad angular icon tool bar. Only thing I cant think of is to block each run then import them back in at 1/10 in y direction. How to get this done faster or more direct by any other methods.
View 6 Replies
View Related
Mar 6, 2003
I have a drawing which contains about 100 "areas". These areas are closed polylines. I would like to get a total area of all these polylines.
I have tried using AutoCAD 2002's AREA command, but I am only able to select one item at a time, (AREA, Add, Object). This is fine for calculating a few areas. It gives me a running total of each item that I select.
Using the LIST command works OK for a few items, but you still have to wade through all the other information to get the area info for each item.
Is there a way to select crossing ALL the areas that I have, and have it return a total?
View 4 Replies
View Related
Sep 27, 2013
what I am attempting -
Pick a line
Pick a starting point on the line
Pick a ending point on the line
Pick side to offset
create list of offset points
Create a new line with a offset
I think I could do this using brute force, but would prefer a mathematical solution.
View 9 Replies
View Related
Jan 1, 2012
the resulting arc-fit pline has each pline segment converted into two arcs, the common radii of which are perpendicular to the original segment (unless direction of curverature changes)
the resulting arcs can be calculated given the angle of the tangents for each segment.
the factors for determining the tangents at vertex N are:
deflection angle at N
deflection angle at N+1 (90° or non-extant = not a factor, 0° or 180° = segment is the tangent)
deflection angle at N-1 (90° or non-extant = not a factor, 0° or 180° = segment is the tangent)
ratio of lengths of segments (N , N+1) and (N , N-1)
I can find the tangents when N±1 = 90° and when the segment lengths are equal but i can't figure out how to compute the tangent if these 3 factors are varied.
I don't want to use (command"._PEDIT" pl "_FIT""") because i need to collect the arc data anyway and at a high frame rate. The data will be used to further compute a spline frame that best fits a quadratic spline to the arcs. That part i know how to do!
View 1 Replies
View Related
Sep 2, 2013
how can you get the last point you picked on a Circle because I was going to run the TTR and use the tanget command and have it exit and I need to get the point I pick on the circle
View 7 Replies
View Related
Dec 12, 2002
I was looking for a post on the subject of line and circle intersections and found one that Bill Z had posted. I decided to incorperate one of the replies into my own code. In particular Luis Esquivel's code. With some minor modifications I was able to add the onseg argument that extends intersection points for the line to the circle. I also modified it to return only one point or two points depending on the line and circle supplied and the onseg argument. It seems to work great.
; test function
(defun c:go ( / )
(ed_init)
(while
(or
(not (setq ent (entsel "
[code].....
View 9 Replies
View Related
May 17, 2013
How do you detect the intersection of a line and circle or arc.
View 1 Replies
View Related
Jul 23, 2004
Routine that will draw a insulation hatch around a circle?
View 9 Replies
View Related
Oct 3, 2013
I need a lisp which is i can draw a line or pline with circle in every 30 meters ( circle diameter and total line or pline length will be optional )
View 6 Replies
View Related
Oct 21, 2013
Can a AutoLISP command be written to read an attribute in a block and draw a circle with the attribute as the diameter using variables? The appilcation is taking the diameter of a tree trunk (the attribute), multipling by 12, and drawing the canopy circle on hundreds of those blocks. So the circles drawn will vary in size.
Not sure how this could be set up, i'm not familiar with LISP writing at all.
1) Read block, single, mulitple or definition?
2) Read Attribute
3) Varaible of attribute, (attribute is an inch measurement...it needs to be multipled by 12 to get feet for final use as circle diameter drawn)
4) Draw circle, variable, with diameter coming from attribute variable (attribute in inches that is multipled by 12)
5) Center point or circle to be block's base point
View 9 Replies
View Related
May 29, 2012
I have a window schedule lisp routine that places a 6-sided polygon around text that label each window. I want to change the code so that its a circle instead of a polygon. Here is the code line that needs to be modified:
(command "polygon" "6" "fro" (cdr (assoc 10 (entget templine)))(strcat "@38,-" (rtos (+ (* linecount 18) 14) 2 0)) "C" "6")
View 7 Replies
View Related
Mar 11, 2013
You have a dwg with multiple sets of different blocks and a circle you want to place on the insert point of each set blocks.
You select the circle then select one of the blocks in the set and the circle is placed on the insert point of each of the blocks in that set. It would save time from doing it manually and save on mistakes.
View 9 Replies
View Related
Feb 10, 2012
I'm trying to change a routine i just wrote that draws 3d pipes. I wanted to make it so that when a user selects the beginning point and ending point of the pipe, the LISP changes the ucs to that vector, draws the circle at the beginning point and extrudes it to the second point.
It actually works great except when the ucs changes, so do my user points because of teh origin change. Is there a better way I might get this to do what I wnat it to?
(setq ip (getpoint "
Pick First Point:"))(setq ep (getpoint "
Pick Second Point:"))(command ".ucs" "za" ip ep)(setvar "osmode" 0)(command ".circle" ip "d" od)(command ".extrude" (entlast) "" (distance ip ep))(command ".ucs" "w")(setvar "osmode" oldsnap))
View 2 Replies
View Related
Aug 6, 2013
How to distribute object (circle) in selection of great number of points?
View 5 Replies
View Related
Oct 13, 2013
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.
(defun c:client ()
(setq old-echo (getvar "CMDECHO"))
(setvar "cmdecho" 1)
[Code]...
I don't have any experience with LISP or any other programming. I have just been cobbling this together from bits and pieces I have found on the web.
View 3 Replies
View Related
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
Nov 26, 2012
how to delete all OLE objects from drawing by most efficient way.
There are abt 150 drawings, each has from 2 to 20 or so OLE objects which need to be deleted. OLE objects are on many paper spaces.
I tried to use qselect but it selects only what is in current space.
Would need some lisp or some other methode than all can be deleted (excluding those which resides in blocks).
Tried also yto use ssx and then erase but still it deletes only what is on current space.
Just as additional info, those OLE are all pictures, not xls files for example.
View 8 Replies
View Related
Oct 18, 2002
How can you open a drawing read-only with autolisp.
View 9 Replies
View Related
Oct 7, 2011
Any lisp routine out there to append (prefix) text to dtext?
i have 100s of dtext that has numbers in them, and i need to place the "#" symbol in front of them now.
View 3 Replies
View Related
Apr 22, 2013
I am trying to insert one or another block into a drawing, and i need to do this 8 times per drawing.
(defun C:detector (/ filename gas pressure)
(repeat 8 (initget 1 "Gas Pressure")
(setq filename (getkword "
Enter Detector Type [Gas/Pressure]: "))
(if (= filename "gas") (command "-insert" "*T:\acad\schematic_circuits\suny\sunygasdetectornew.dwg" pause "" "")
(or (if (= filename "pressure")
(command "-insert" "*T:\acad\schematic_circuits\suny\sunypressuretransmitternew.dwg" pause "" ""))
) ;;end or
) ;;end if
) ;;end repeat
)
View 4 Replies
View Related
May 27, 2012
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..
(defun c:test () ;;------------=={ Set Dynamic Property Value }==--------------;;;;;;;; Modifies the value of a Dynamic Block Property ;;;;-------;;;; Author: Lee Mac, Copyright © 2010 - www.lee-mac.com ;;;;---------------------;;;; Arguments: ;;;; block - VLA Dynamic Block Reference Object ;;;; prop - Dynamic Block Property Name ;;;; value - New value for Property ;;;;------------------;;;; Returns: Value property was set to, else nil ;;;;-------------------;;(defun LM:SetDynamicPropValue ( block prop value ) (setq prop (strcase prop)) (vl-some (function (lambda
[code]....
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).
View 2 Replies
View Related
Oct 4, 2013
As you smart individuals can figure out, we do up drawing packages for construction that consist of several drawings, hundreds of drawings, for several modules of construction. Our process usually consists of one layout per drawing, so that the lisp guy can do a drawing count and put in sheet numbers based on how I manipulate the list of drawings in the one directory folder.
Now I have a client, despite the way we currently do things, requires that about 70% of the drawings will have multiple layouts. Now we're back in the stone ages, manually putting in sheet numbers, eating up our budget for this contract.
View 4 Replies
View Related
Aug 19, 2013
how to use AutoLISP to draw lines between two points. I have x,y,z coordinates for the end points in an excel sheet which I can save as a text file. I need to pull the coordinates from the file and use them to draw the lines. There are 2000+ lines so it is not feasible to draw them manually.
View 8 Replies
View Related
Dec 5, 2012
I have the following string of code, that I'll write in everyone's start-up suite. I'm able to retrieve a list of files I want to modify, for whatever reason. (One example, when plotting drawings with layouts, sometimes the shadeplot setting is wireframe, and not classic hidden, though it's been set up in our templates).
The huge question is, can I get a list of drawings to a variable in one drawing, and have access to that variable list, in the next drawing I open? I'll iron out the bugs on read-only statuses, or manipulating drawing states later.
(defun GetDrawings ()
(setq currentpath (getvar "dwgprefix"))
(command "pspace")
(setq DrawingList (dos_getfilem "Select a file" currentpath "Drawing files (*.dwg)|*.dwg|All files (*.*)|*.*||"))
(setq ListOfDrawings (cdr DrawingList))
(setq DrawingPath (nth 0 DrawingList))
[code]...
View 1 Replies
View Related
Oct 2, 2011
I know through the block command you can write out a selection of entities to a single drawing.But what I am wondering is if it is possible to have two drawings open, and transfer data quickly between the two?
As an example as we are detailing an assembly we create a title block around a detail, put dimensions and notes on as needed and would then like that to be transfered into another drawing next to the previously transfered detail drawing.
View 9 Replies
View Related
Jul 30, 2013
I'd like to create a lisp that would check my drawings for stray vertices (I only draw in full measurements per UCS), and automatically round them up to the closest whole value, or at least mark them up in circles for manually fixing them.
View 1 Replies
View Related
Aug 9, 2013
I need lisp that draws rectangle between two lines by window selection. As attached.
View 3 Replies
View Related
Nov 13, 2001
can you start autocad with no drawing open ?
i would think that some type of script would work or could you change your target on a shortcut?
View 4 Replies
View Related
Nov 28, 2013
Is there a way of opening existing cmds in the visual lisp editor and edit them to do something else? I'd like to set up a lisp where 'uu' would switch the drawing units from decimal to architectural units and hittng 'uu' again would switch it back.
View 4 Replies
View Related