AutoCAD Visual LISP / AutoLISP :: Breaking Objects Intersecting With A Polygon And Erasing

Apr 5, 2013

Breaking objects intersecting with a polygon and erasing them with an option outside/inside,

I couldn’t find out a single  lisp file that can

Break all objects intersecting with a particular polylineAnd then erase objects with an option to choose inside/outside objects

Software: AutoCAD 2014, AutoCAD C3D, AutoCAD M3D, Revit
Windows 7 (Ultimate 64 bits),
Firefox 20.0,
Kaspersky 2013.

View 4 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Create Sub Areas From Intersecting Polylines

Oct 17, 2011

Essentially, I'll be creating a sort of Venn diagram.  So for the purposes of this exercise, let's assume it's the classic Venn diagram of three intersecting circles.  But I need this to work with closed polylines, that may also have arc segments in them.

Anyway, so I have these intersecting areas, and I need to create bounding polylines for each area, and assess the number of overlaps.  So, as in a Venn diagram, the areas where only one circle is present can then get shaded one color, areas where two circles are overlapping can get a different color, and the area where all three circles overlap can get a third color.

I'm clearly going to have to be converting the various boundaries to Regions, and performing some Unions.  It seems I could grab all objects, convert them to Regions 2 at a time, and compare their Union'ed area to their individual area, to determine if they overlapped at all.  With only the 3 cirlces, that would work, but when I have 35 individual polyline areas with arcs, suddenly this method feels like it will break down.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Polygon From Distance Between Point

Sep 18, 2013

I need a lisp that creates a polygon of N points, so to enter a only the distance between these points, after choosing N points in the drawing for approximately creating polygons.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Saving Areas Of All Closed Polygon

Mar 4, 2013

I'd like to get areas from all closed loop polygons of my drawing and save them. 

From my point of view, the function would be to:

- hatch every polygon of my drawing
- for each hatch do
- extract area and put it in an array with the variables (name of polygon  and area).

And then is it possible to save it in a DWG or DXF file in order to reuse these areas by another program ?  

View 9 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 :: Change 6 Sided Polygon To Circle Around Text

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

AutoCAD Visual LISP / AutoLISP :: How To Find If Point Inside Polygon / Block's Area

Sep 20, 2011

How would I go about this.  if a two blocks or polygons are overlapping area? 

A good method or the algebraic formula for a function to tell me if a point is inside a polygon or block's area? 

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Do Lines / Polyline On Line Edges Creating Polygon

Oct 22, 2013

I really need a auto lisp that do lines/polyline on line edges creating a polygon like the example.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Getting Objects Layer?

Feb 7, 2010

How can I get the layer that an entity is on. I have tried numerous method but they don't seen to be retrieving the layer information.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Delete All OLE Objects From Drawing

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

AutoCAD Visual LISP / AutoLISP :: Reactors And Objects With Fields

Mar 7, 2012

I am trying to add a reactor, where if the object i move or copy is s a block of a certain name, then i would like to run update field on the last object (being copied) or the object being moved.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Multiple Hyperlinks On Objects

Jan 11, 2013

The below adds a hyperlink to the selected object.How might it have to change to add multiple hyperlinks?

(entmod
 (append (entget (car (entsel)))
     (list
      (list -3
         (cons "PE_URL"
            (list
             (cons 1000 "..\..\90 Submittals\90-3 O&Ms\fig83-clevishanger.pdf") ; Relative Path to a pdf file.
             (cons 1002 "{")

[code]...

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Take Two Objects And Swap Their Positions?

Sep 19, 2011

I have been searching for some information on how to pass objects into a function so I can mess with their properties. Somehow I haven't been very successful. Anyway...What I want to do is take two items (light fixtures) and swap their positions on the drawing. It seems like it must be really simple, but I'm just not finding the key puzzle pieces to do it. It seems like if I could figure out how to pull two objects into the function (whether by selecting them and running the function or by selecting them after I run the function) I could very easily save the coordinates of one to variables and then just swap them.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Exporting List Of Objects

Jan 6, 2012

How to export to a txt file a list containg all the objects on the current layer and their properties?

To be precise, I would like to export the following items from a selection of plines:

- ObjectID;
- Start Point;
- End Point;
- Vertex Points;
- Width.

View 3 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 :: Selecting Multiple Objects

Nov 2, 2011

How to modify this routine so that I can select multiple objects as opposed to one at a time?

(Defun c:cd ()
(setq newdim (entsel "
Select Dimension to clear:"))
(setq newdimvalue " ")
(command "dimedit" "n" newdimvalue newdim "")
(princ)
)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Area Of Multiple Objects

Nov 3, 2008

I have a lisp I use to calculate the area of an object. The section below is the area part of it:

(setq ojt (entsel "Select object to get area of... "))

(command "area" "o" ojt)

(setq oarea (getvar "area"))

I want to modify it to add the areas of multiple objects. Unfortunately it is not as simple as;

(setq ojt (ssget "Select object to get area of... "))
(command "area" "a" "o" ojt)
(setq oarea (getvar "area"))

So how would I go about doing it?

View 7 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 :: Draw All Objects At Same Time?

Sep 24, 2012

I have made a lisp routine to draw lines on polyline. And here are a lot of lines on it. So using comand

"(command "line" pt1 pt2 " ")"

takes a lot of time. Is here a way to creat lines in memory or similar and only then draw them all on screen?

I have search but coudin't find any info. I do not know how to formulate a query.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Objects In The X / Y Plane Only

Jul 29, 2013

I want to move a large 3D steel file on top of a 2D architectural background. The ISSUE is that when i move it (in plan view "aka top view") the X,Y coordinates change AND the Z coordinate changes... But, I want the Z coordinate to stay the same . I wrote a LISP file that doesnt seem to work (SEE BELOW):
 
(defun C:MoveXY (/ PT1 PTB PT2)(setvar "CMDECHO" 0)(setq PT1 (getpoint "
Specify Base Point or [Displacement] Displacement: ")PTB (getpoint "
Specify second point or <use first point as displacement>: ")PT2 (list (car PTB)(cadr PTB)(cddr PT1)))(command "_.MOVE" (SSGET) "" PT1 PT2))

It seems my issue comes when i get to the command line (ssget) seems to mess it all up . How to use the ".Move" command with the (ssget) function?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: New Layer For Selected Objects

Jan 1, 2014

I need a LISP that create a new layer and ask me for the name and the other properties (color,lw,lt..).

ask me if I want move the selected object for the new layer (yes is the default value)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Detect If There Are Objects Selected

Oct 18, 2012

Any way to detect of there are objects currently selected using Autolisp, visual lisp or even VBA. I would like to be able to do something using that as a conditional, so that (assuming the hypothetical variable isSelected is an on/off indicator of whether or not something is selected) I can code something like this:

(if (isSelected) (...))

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Objects To Different Layer Is Slow

Nov 26, 2013

I find that the command to move objects to a different layers runs very slow in one of the drawing.  I want to find out what wrong with the drawing and how to speed things up.

I have a LISP program that batch processes a large number of drawings.  One of the step to process each drawing is to change the colors of some objects according to the status of the objects.  I do this by moving the objects to a later that has the right color.  So far the program only takes 2 to 4 minutes to process each drawing.  But the program takes close to 90 minutes to process one specific drawing.  I track down the problem has to do with the command that moves the objects to the right layer, like this:
 
(vl-cmdf "_.chprop" (ssget) "" "_layer" "ABC-Prod-Good-Pcs" "")

 This command takes a very long time to finish, like 40 minutes each time it runs (to move 1200+ objects), and the program needs to run it twice for a total of approximately 80 minutes.

Please note that the drawing itself is not the largest drawing, and it doesn't have the largest number of objects to be moved either.  It is close to the top-5 drawings in term of drawing size and the number of objects to be moved. I cannot say that the drawing size or the number of objects to be moved are the cause of the problem.

I tried to "speed up" by moving 200 objects incrementally.  That didn't work. I tried to "speed up" by moving 100 objects incrementally and saving the drawing after each 100 objects are moved.  That didn't work either; actually the speed is slightly slower than simply moving 1200+ objects all at once.

I don't know what to do.  I believe there may be something unusual about that drawing.  By the way, the reason why I choose to change color by moving objects to a different layer has to do with the fact that I have found this is the best way so far. I tried to change the color of the objects directly.  But I find that the color of some sub-parts of the objects are not changed (because their color is by-layer). That's why I choose to change color by moving objects to a different layer.

How I can check the drawing, any different way to change color that is better.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Move Selected Objects By Value Of Their X Or Y Properties

Nov 23, 2012

I need a program to move some selected text to a line something like as extend command but for text objects!

suppose that there is a horizental line (y=constant) or vertical line (x=constant) and some selected text(or other objects), I want a lisp program that move these selected text (or objects) by their "insertion point" to this line.

in other word, if the selected base line is horizental (y=constant) then property of "Y" of all selected text should change to line's "Y"; and if selected base line is vertical (x=constant) then value of "X" of all selected text should match to line's "X" value.

for example, for base vertical line (x=constant) and 3 selected text(or can be any object) result is:

text1.          |                        text1.|

  text2.        |         ===>       text2.|

    text3.      |                        text3.|

|  .text1                                 |.text1

|    .text2                ===>       |.text2

|      .text3                             |.text3

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Attach Classification Definitions To MEP Objects

Nov 25, 2011

The CADdesigners have asked me if i can make a function that runs through our AutoCAD 2012 MEP model attaching certain predefined classification definitions to ducts, pipes, MVparts etc.

I have used hours searcing for examples / tutorials on how to connect to the MEP objects not finding what i need.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Scale Text Objects

Jan 8, 2014

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.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: SSGET For Selecting Multiple Objects

Nov 27, 2012

I have this code that I wrote years ago that I want to update to select two types of civil3d objects and show them selected with grips on the screen. This function works fine

(defun CELFEATURE ()
(ssget "_X" '((0 . "AECC_FEATURE_LINE")))
(setq sset (ssget "P"))
(if sset
(progn
(sssetfirst sset sset)
;(command "_.PROPERTIES")
)
)
)
(defun cF () (CELFEATURE))

but if I add the extra object like this which I assume is the wrong syntax i only get the second type of objects. Need correct syntax I should be using for selecting more than one object in an ssget statement.

(defun CELFEATURE ()
(ssget "_X" '((0 . "AECC_FEATURE_LINE","AECC_AUTO_CORRIDOR_FEATURE_LINE")))
(setq sset (ssget "P"))
(if sset
(progn
(sssetfirst sset sset)
;(command "_.PROPERTIES")
)
)
)

(defun cF () (CELFEATURE))

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Several Objects And Get Starting / Endpoint Of Each One

May 4, 2013

I want to make it so that I can keep selecting several objects and get all the starting points and endpoints of each one with (setq ent (entsel))

(Defun c:demo (/ ent)
(setq ent (entsel))
(princ)
)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Moving Objects Vertically In 3d View

Jan 1, 2014

I am having trouble moving an object a certain distance. The distance is defined by a pre-defined variable. I just can't figure out the syntax for the autolisp command.

Here is the bit of code if written, there is more code not shared here that defines the points for the polyline .

;-- the varaible box_height is defined earlier in the routine

;-- Draw the polyline for the top of the cabinet
(command "pline" p1tt P2tt P3tt P4tt P5tt P6tt P7tt P8tt "c")

;-- Assign the new part a variable name
(setq cab_toppl (entlast))

;-- Extrude the polyline to make the top of the cabinet
(command "extrude" cab_toppl "" cab_intw "0")

;-- Assign the new part a variable name
(setq cab_top (entlast))

;-- Rotate the top of the cabinet down to the floor of cabinet

(command "rotate3d" cab_top "" 2 p1tt p2tt 90)

;-- Move the top of the cabinet to the final location

;--  HERE IS THE PART I'M HAVING TROUBLE WITH.  ESSENTIALLY ONCE THE PART IS CREATED I'VE NAMED IT CAB_TOP AND AM NOW TRYING TO MOVE IT IN THE Z AXIS THE DISTANCE DEFINED BY THE VARIABLE BOX_HEIGHT WITHOUT USER INPUT

(command "move" cab_top "" "0,0,0" (list (0 0 (box_height) "") 

;--THIS PART IS OKAY

(setvar "CLAYER" oldlayer) ;restore active layer

(setvar "BLIPMODE" 1)
(setvar "OSMODE" 135)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Polyline Objects - Draw MLINE

Sep 2, 2013

I have drawings with a lot of polyline objects. I need a routine which will draw multilines by coordinates of vertexes of this polylines. For example, if there is a pline with coordinates 10,10 - 20,20 i want to draw in other layer MLINE with the same coordinates. I know it's should be simple but can not gues how to do it. I've never used LISP before.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Converting Objects Of Certain Linetype To A New Layer

Oct 26, 2012

I would like converting all objects that has forced linetype to be on a linetype layer.

So if there are objects that have forced linetypes - dashed/hidden/phantom, etc., those entities would be moved to a linetype layer based on their forced linetype.   The entities would all be changed to color bylayer, linetype bylayer.

So if there is a rectangle that is sitting on an EQUIPMENT layer, the routine would put that rectangle on a new layer called DASHED and change its forced linetype to BYLAYER.

Lastly, once that's done, the next and final step is to locate a the existing layers with matching linetype - say, OBJECTS with DASHED as a linetype, and merging it to that layer.

View 9 Replies View Related







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