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:
intersect line draw
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: intersect line draw (Read 1483 times)
0 Members and 1 Guest are viewing this topic.
dussla
Bull Frog
Posts: 297
intersect line draw
«
on:
May 05, 2012, 08:19:55 PM »
sorry sorry for many ask
really sorry
i am making patter line
if you see my attached file . you can understand my work
in my work , that pattern is used often
it is difficult to make that pattern withmy poor lisp skill
pls can you make me that lisp
Logged
irneb
Water Moccasin
Posts: 1794
ACad R9-2016, Revit Arch 6-2016
WWW
Re: intersect line draw
«
Reply #1 on:
May 06, 2012, 07:43:34 AM »
Try this one:
Code - Auto/Visual Lisp:
[Select]
(
vl-load-com
)
(
defun
c:PatternLine
(
/
p1 p2 ss en par baseline dir wid ptlst n pt
)
(
if
(
and
(
setq
p1
(
getpoint
"Pick 1st point of crossing line: "
)
)
(
setq
p2
(
getpoint
p1
"Pick 2nd point of crossing line: "
)
)
(
setq
ss
(
ssget
"_F"
(
list
p1 p2
)
'
(
(
0
.
"LWPOLYLINE"
)
)
)
)
)
(
progn
(
setq
ss
(
ssnamex
ss
)
en
(
cadar
ss
)
par
(
vlax-curve-getParamAtPoint
en
(
cadr
(
cadddr
(
car
ss
)
)
)
)
wid
(
/
(
-
(
vlax-curve-getDistAtParam
en
(
1+
(
fix
par
)
)
)
(
vlax-curve-getDistAtParam
en
(
fix
par
)
)
)
2
.
)
dir
(
apply
'
angle
(
list
(
vlax-curve-getPointAtParam
en par
)
(
vlax-curve-getPointAtParam
en
(
if
(
<
(
-
par
(
fix
par
)
)
0.5
)
(
fix
par
)
(
1+
(
fix
par
)
)
)
)
)
)
baseline
(
list
(
polar
p1 dir wid
)
(
polar
p2 dir wid
)
)
n
0
ptlst
(
list
(
car
baseline
)
)
)
(
foreach
lst ss
(
setq
en
(
cadr
lst
)
pt
(
vlax-curve-getClosestPointTo
en
(
cadr
(
cadddr
lst
)
)
t
)
p1
(
apply
'
inters
(
append
baseline
(
list
pt
(
polar
pt dir wid
)
)
)
)
p2
(
polar
p1 dir wid
)
ptlst
(
if
(
=
(
rem
n
2
)
0
)
(
cons
p2
(
cons
p1 ptlst
)
)
(
cons
p1
(
cons
p2 ptlst
)
)
)
n
(
1+
n
)
)
)
(
setq
ptlst
(
cons
(
if
(
=
(
rem
n
2
)
0
)
(
cadr
baseline
)
(
polar
(
cadr
baseline
)
dir wid
)
)
ptlst
)
)
(
entmake
(
append
'
(
(
0
.
"LWPOLYLINE"
)
(
100
.
"AcDbEntity"
)
)
(
list
(
cons
67
(
if
(
>
(
getvar
'CVport
)
1
)
0
1
)
)
(
cons
8
(
getvar
'CLayer
)
)
)
'
(
(
100
.
"AcDbPolyline"
)
)
(
list
(
cons
90
(
length
ptlst
)
)
)
'
(
(
70
.
0
)
(
43
.
0.0
)
(
38
.
0.0
)
(
39
.
0.0
)
)
(
apply
'
append
(
mapcar
'
(
lambda
(
pt
)
(
cons
(
cons
10
pt
)
'
(
(
40
.
0.0
)
(
41
.
0.0
)
(
42
.
0.0
)
(
91
.
0
)
)
)
)
(
reverse
ptlst
)
)
)
'
(
(
210
0.0
0.0
1.0
)
)
)
)
)
)
(
princ
)
)
Logged
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
intersect line draw