AutoCAD Visual LISP / AutoLISP :: Select Lines / Plines That Intersect Given Pline

Sep 13, 2012

I need to change the color of all lines/plines that intersect a given pline. How would I go about making the selection set of all lines that intersect that given pline.

View 8 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: How To Select Several Plines And Export Their Vertexes

Jun 29, 2012

Yesterday I post the message "Exporting pline and text" which turned out to work realy well.

However I need something else...

I need to select several plines and export their vertexes (as it is already done) BUT I also need to select SEVERAL texts and export them as well as their insertion point coordinates.

I tried with the code below but without any success... It gives the error "; error: ActiveX Server returned the error: unknown name: "TEXT"" This happens after selecting some texts and hiting enter.

Here is the

(defun c:zi5 ( / f i o s ss obj objdata texto texto_f nomebase nome_zi tx1 iPt)(vl-load-com)(setq nomebase (getstring "
Enter name for file:"))
(setq nome_zi (strcat "D:" nomebase "_zi.txt"))
(princ "Select your plines...")
(if (and (setq s (ssget '((0 . "LWPOLYLINE")))) (setq f (open nome_zi "w")) )

[Code]...

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set All Lines And Plines Scale To 1

Jul 15, 2013

I am working on a script.  I need to select all lines and polylines and set there linetype scale to 1. 

I'd take a simple lisp routine if that would be easier.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Intersect Between Two Lines Using Start And End Values Of Two Lines

Oct 11, 2013

With all of you fine teachers, I have the know-how to get the start and end values of a line.

Do you think there is a way to get a point returned that represents the true intersection of the two lines, without having to involke a user defined "getpoint" function using "intersect" osnap?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert 2D Pline With OCS Into 3D Pline In WCS

May 29, 2012

I have LWPOLYLINEs that represent a cross section of a train tunnel. Each LWPOLYLINE lists its 2D points in an Object Coordinate System.My task is to create 3D Polylines in WorldCoordinateSystem using those LWPOLYLINEs.I have posted a drawing with sample objects.

I have attached a sample drawing. Drawing was created with Civil 3D 2013, but I exporttoautocadr12dxf'd it and then save to 2004 dwg so most should be able to open it.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create Some Plines In A Drawing

Sep 10, 2013

I have to create some plines in a drawing from the inputs provided by the client. I prepared a lisp code for it. I have to use it to 1000 drawings. Every time I open the drawing and running the lisp command.

Is any lisp code to run in bulk open drawings with out entering command prompt.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Adding / Removing Vertex To Several Plines At Once

Feb 27, 2012

I'm looking for something that, after selecting several plines (overlaped or not), I can insert/remove vertexes.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Label Contour (2D Plines) From Elevation

Nov 21, 2013

Of course with ACAD MAP (FDO Labels for example) or better with ACAD CIVIL : no problem !

But often I have to use a Standard AutoCAD ...

A lots of people have already asked for this routine :

But I search in this forums and some others and unfortunately I can't find any correct routine Full operational on ACAD 201X 32/64 bits

I have many 2D Plines with an Elevation : some Normal , some have been splined --> 1st problem

I would like to label them with :

- either a Block with ONE attribut : the elevation

- either a MText with a blank Mask behind

As you wish ...

Question : Size/Height of the Block or MText ?

Some 2D Plines are very long (2nd problem) so I would like a question like :

Label each Pline every xxxx Units ?

So on a Pline Contour of 2000 meters, I could have the elevation (Block or MText) every 50 meters ...

Of course I would like that the Block or Mtext will have to follow (rotation) the Pline (splined or not) where the label is inserted !

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Pline Dimensioning

Sep 2, 2005

I am looking for an AutoLISP routine, which gives all aligned dimensions of a closed polyline, drawn in 3d.

I have attached a 2D drawing for reference.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get X / Y Coordinates Of A Pline

Feb 1, 2012

 Is there anyway to use LISP to list the x,y coordinates of a pline?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Join (All To Pline)

Sep 26, 2013

In continuation with thread All to Pline . I want to add one more function to this lisp i.e. Join all the objects selected.

Can this be done?

I tried this:
(command "_.pedit" "m" ename "" "j" ename "")or (command "_.pedit" "" "j" ename "" "")
 
But it gives me an error something like this:

Requires numeric distance, two points, or option keyword.
; error: Function cancelled

Enter fuzz distance or [Jointype] <0.000>: j

Enter join type [Extend/Add/Both] <Extend>: *Cancel*

or

Command: ch2pl

Select objects: Specify opposite corner: 5 found

Select objects:

*Invalid selection*
Expects a point or
Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon/Multiple]:
; error: Function cancelled
Select polyline or [Multiple]:
Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype
gen/Reverse/Undo]: *Cancel*

Command: Specify opposite corner:
Command: *Cancel*

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Use Osnap APParent Intersect

Feb 2, 2000

How can use the Osnap "APParent Intersect" into a Lisp.Others osnap options use only one point as CENter option below:

(setq pt2 (osnap pt1 "cen"))

But to use APParent Intersect ou Perpendicular is necessary two points.I've tried use:

(setq pt2 (osnap pt1 "app"))
(setq pt2 (osnap pt1 pt2 "app"))
(setq pt2 (osnap pt1 "app" pt2))
(setq pt2 (osnap "app" pt1 pt2))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Pline Start And End Angles

Dec 3, 2012

Is there a function to obtain the start angle and end angle of a pline, i know arcs do.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Fillet Pline Vertex

Aug 8, 2012

I have this code to make fillet to a polyline, but the command does not allow specify fillet radius. How I can change the routine?
 
(defun C:filletv ( / ent ) (setvar "FILLETRAD" 2.500) (if (setq ent (entsel "
Select element near vertex: ")) (command "_fillet" "_P" ent) ) (princ) )

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Create Pline In Modelspace

Feb 15, 2013

I have been using one routine very successfully to create a pline in modelspace that has the outline of the chosen viewports in the drawing. This one works great.

Now I am trying add other routines that I've done to better fit my needs. If I use each routine individually at the command line they work, but when I use all in a single command I got the following errors:

The routine SetColor - does not change color to Bylayer The routine RectWidth - ; error: bad SSGET list

Why?

See the attached file for more details and be free to improve whatever you want in my routines because they are very basic.

And, if I am not asking to much, is that possible to not be prompt to select objects? I mean, the routine could automatically select all viewports in the drawing...

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Finding 2 Points Along A Pline

Jul 7, 2013

I have plines of circuits that sometimes have T's (line goes along, then T's out then back to T point and then continues).

Here is example line -

(setq List_Pline (list (list 0 0) (list 1 1) (list 0.5 1.5) (list 1 1) (list 2 2) (list 3 3) (list 3.5 2.5) (list 3 3) (list 4 4)))

nth 0 = (0 0)
nth 1 = (1 1)     - T point
nth 2 = (0.5 1.5)
nth 3 = (1 1)     - T return point
nth 4 = (2 2)
nth 5 = (3 3)     - T point
nth 6 = (3.5 2.5)
nth 7 = (3 3)     - T return point
nth 8 = (4 4)

I need to be able to pick 2 points along the line and find the shortest route.

Examples - 

1st point at 1,1 and 2nd point at 3,3 - new line is nth's 3,4,5

1st point at 0,0 and 2nd point at 1,1 - new line is nth's 0,1

1st point at 2,2 and 2nd point at 3,3 - new line is nth's 4,5

1st point at 3,3 and 2nd point at 4,4 - new line is nth's 7,8

1st point at 0,0 and 2nd point at 3,3 - new line is nth's 0,1,2,3,4,5

1st point is 1,1 and 2nd point is 1,1 - new line is nth's 1,2,3

I've tried using vlax-curve-getParamAtPoint, but it returns 1st T point.

Synopsis of program -

Select Pline

Pick 1st point

check if on line

Pick 2nd point

check if on line

check if 2nd point is before 1st point, if so swap locations

find last nth of 1st point

find 1st nth of 2nd point

return list

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Pline Vertex In Wrong Layer?

Sep 21, 1999

I have been having a few 3dpline's with the last vertex being in a different layer. I saw a site mention that this is an AutoCAD 14 bug that could be caused if a program does not end the pline with the layer being set properly before doing a seqend command. If I move the entity to another layer and then back to the correct one it will fix it. Audit in R14 will not show any errors. If I export the file to AutoCAD 12 , audit will detect and fix the problem. I would like to find a Lisp, ARX, etc. that would check for this problem and fix, change color or layer, or whatever.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Rounding Of Line And Pline Vertices

Sep 4, 2013

Now I have all block instances rounded into a 5mm-accuracy. How to also round in Line start and end points (and maybe even polyline vertices) into a 1mm (or custom) accuracy. There are hundreds of inaccurate line elements within the drawing .

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change LType In A PLINE Drawn

May 30, 2013

How to change the ltype in a PLINE drawn whith this
 
(defun c:cordaluminosa ()(if (tblsearch "LAYER" "Elétrico - Luminotécnico")(command "_.-layer" "_THAW" "Elétrico - Luminotécnico" "_ON" "Elétrico - Luminotécnico" "_SET" "Elétrico - Luminotécnico""")(command "_.-layer" "_MAKE" "Elétrico - Luminotécnico" "_COLOR" 3 "" ""))(command "._pline")(while (wcmatch (getvar "cmdnames") "*PLINE*")(command pause)))
 
I want to set the ltype FENCELINE1 to this object.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Calculate Points Offset To Pline

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

AutoCAD Visual LISP / AutoLISP :: Calculate Tangents For Pline Fit Curve?

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

AutoCAD Visual LISP / AutoLISP :: Delete Vertex From 3D Pline Without Making New Entity?

Dec 6, 2007

I have a program that makes 3d polylines from various data. That 3d pline then gets added to a civil 3d surface as a breakline. I want to modify the pline with my program, but preserve the handle, as I think that is what C3D uses to decide if its part of the surface. I tried this as a sample with no luck:

;DELETE 3RD VERTEXT FROM 3D PLINE
(DEFUN C:T3 ( / EN ENAME ENT ENTL)
;GET 3D PLINE
(SETQ ENT (ENTSEL "
Select 3D Pline:")

[Code] .....

I know you can modify a vertex, but what about add and delete with entmake and entmod? I also considered using activex for this task, but you can only add verticies from what I could tell in the object browser of VBA, not delete them.

What I will be doing is deleting all the verticies and adding back the correct ones. Or if there was a way to transfer a handle to a new entity after deleting the old, that would suffice too.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Line / Pline To Match TEXT Rotation?

Oct 7, 2011

There are a ton of lisp to match text rotation to a selected line, but not vice versa.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Construct Lines Between Lines Ending Points Multi Selection?

Aug 3, 2013

I want to construct lines between every two line ending point by multi selectio window instead of drawing it manually between lines ending point ?

View 3 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 :: 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 :: 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 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