Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Mark Error circles at Intersections of polylines
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Mark Error circles at Intersections of polylines (Read 1813 times)
0 Members and 1 Guest are viewing this topic.
chvnprasad
Guest
Mark Error circles at Intersections of polylines
«
on:
April 13, 2012, 02:39:27 PM »
Hi,
I am new to autolisp, I need to find out all poly lines intersections in a drawing files,and place the error circles at these intersection location and zoom that location one by one as per error markers.
Logged
Lee Mac
Seagull
Posts: 12925
London, England
WWW
Re: Mark Error circles at Intersections of polylines
«
Reply #1 on:
April 13, 2012, 07:16:24 PM »
Look into the 'IntersectWith' method.
Here are some example functions to help you toward your goal:
Code - Auto/Visual Lisp:
[Select]
;;----------------=={ Intersections in Set }==----------------;;
;; ;;
;; Returns a list of all points of intersection between ;;
;; objects in a selection set ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; ss - SelectionSet ;;
;;------------------------------------------------------------;;
;; Returns: List of intersection points, or nil ;;
;;------------------------------------------------------------;;
(
defun
LM:IntersectionsInSet
(
ss
/
i1 i2 ls o1 o2
)
(
repeat
(
setq
i1
(
sslength
ss
)
)
(
setq
o1
(
vlax
-
ename
->
vla-object
(
ssname
ss
(
setq
i1
(
1-
i1
)
)
)
)
)
(
repeat
(
setq
i2 i1
)
(
setq
o2
(
vlax
-
ename
->
vla-object
(
ssname
ss
(
setq
i2
(
1-
i2
)
)
)
)
ls
(
append
ls
(
LM:GroupByNum
(
vlax-invoke
o1 'intersectwith o2 acextendnone
)
3
)
)
)
)
)
ls
)
;;-----------------=={ Group by Number }==--------------------;;
;; ;;
;; Groups a list into a list of lists, each of length 'n' ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2010 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; l - List to process ;;
;; n - Number of elements by which to group the list ;;
;;------------------------------------------------------------;;
;; Returns: List of lists, each of length 'n' ;;
;;------------------------------------------------------------;;
(
defun
LM:GroupByNum
(
l n
/
r
)
(
if
l
(
cons
(
reverse
(
repeat
n
(
setq
r
(
cons
(
car
l
)
r
)
l
(
cdr
l
)
)
r
)
)
(
LM:GroupByNum l n
)
)
)
)
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Mark Error circles at Intersections of polylines