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:
Help me to fix a code : Connect attribiute points with line by point number
« previous
next »
Print
Pages:
1
[
2
]
All
|
Go Down
Author
Topic: Help me to fix a code : Connect attribiute points with line by point number (Read 657 times)
0 Members and 1 Guest are viewing this topic.
mhy3sx
Newt
Posts: 26
Re: Help me to fix a code : Connect attribiute points with line by point number
«
Reply #15 on:
March 10, 2023, 05:30:40 AM »
Hi, is it possible to zoom every time to the given point area . I want to say not to zoom in to the given block point number but to a close area of the point.
Thanks
Logged
mhy3sx
Newt
Posts: 26
Re: Help me to fix a code : Connect attribiute points with line by point number
«
Reply #16 on:
March 11, 2023, 10:55:49 AM »
Hi I try to add
Code:
[Select]
(vl-cmdf "mspace" "zoom" 20 pv)
To zoom near the select attribute number so ,I can see the next points. For the first point works but for the next points don't working. Any ideas?
Code - Auto/Visual Lisp:
[Select]
(
defun
c:lineat2
(
/
data AllPointnumber stop pts data i p pv pts_
)
(
vl-load-com
)
(
setq
ped
(
getvar
'peditaccept
)
)
(
setvar
'peditaccept
1
)
(
if
(
setq
AllPointnumber
nil
stop
nil
pts
nil
data
(
ssget
"_X"
(
list
'
(
0
.
"INSERT"
)
'
(
66
.
1
)
'
(
2
.
"Point,KORYFES,station,trigonom,KOKAEK,KOROT,Ktir"
)
(
cons
410
(
getvar
'Ctab
)
)
)
)
)
(
progn
(
repeat
(
setq
i
(
sslength
data
)
)
(
if
(
setq
p
(
vl-some
'
(
lambda
(
x
)
(
if
(
eq
(
vla-get-tagstring
x
)
"POINT"
)
(
list
(
vla-get-textstring
x
)
(
vlax-get
e 'Insertionpoint
)
)
)
)
(
vlax-invoke
(
setq
e
(
vlax
-
ename
->
vla-object
(
ssname
data
(
setq
i
(
1-
i
)
)
)
)
)
'GetAttributes
)
)
)
(
setq
AllPointnumber
(
cons
p AllPointnumber
)
)
)
)
(
setq
allpointnumber
(
vl
-
remove
-
if
(
function
(
lambda
(
x
)
(
eq
(
car
x
)
""
)
)
)
allpointnumber
)
)
(
setq
2bjoin
(
ssadd
)
)
(
while
(
null
Stop
)
(
setq
pv
(
getstring
"
\n
Give point number <Space to continue or Enter to finish and convert to polyline> :"
)
)
(
vl-cmdf
"mspace"
"zoom"
20
pv
)
; <--- I add it here
(
cond
(
(
setq
a
(
assoc
(
strcase
pv
)
AllPointnumber
)
)
(
setq
pts
(
cons
(
cadr
a
)
pts
)
pts_
(
cons
(
cadr
a
)
pts_
)
)
(
if
(
=
(
length
pts
)
2
)
(
progn
(
entmakex
(
list
(
cons
0
"LINE"
)
(
cons
10
(
car
pts
)
)
(
cons
11
(
cadr
pts
)
)
)
)
(
setq
pts
(
list
(
car
pts
)
)
)
(
ssadd
(
entlast
)
2bjoin
)
)
)
)
(
(
eq
pv
""
)
(
setq
stop
"Done"
)
)
(
(
eq
(
strcase
pv
)
"U"
)
(
entdel
(
setq
del
(
ssname
2bjoin
(
1-
(
sslength
2bjoin
)
)
)
)
)
(
ssdel
del 2bjoin
)
(
setq
pts_
(
cdr
pts_
)
pts
(
list
(
car
pts_
)
)
)
)
(
(
null
a
)
(
princ
"
\n
<<Point value not found>>"
)
)
)
)
(
initget
"Yes No"
)
(
setq
convert
(
cond
(
(
getkword
"
\n
Convert to polylines? [Yes/No] <N>: "
)
)
(
"No"
)
)
)
(
if
(
eq
"Yes"
convert
)
(
command
"_.pedit"
"_M"
2bjoin
""
"_J"
""
""
)
)
)
)
(
setvar
'peditaccept ped
)
(
princ
)
)
Thanks
Logged
mhy3sx
Newt
Posts: 26
Re: Help me to fix a code : Connect attribiute points with line by point number
«
Reply #17 on:
March 12, 2023, 03:42:48 AM »
Is It possible?
Thanks
Logged
mhy3sx
Newt
Posts: 26
Re: Help me to fix a code : Connect attribiute points with line by point number
«
Reply #18 on:
March 12, 2023, 12:38:56 PM »
I find this code. This code Find block by attribute value. Unfortunately, didn't work for multiple blocks. Find one attribute tag and stop. Can anyone fix it to work for multiple block tags and join it with lineat2 lisp code? The idea is when I use leanatt2 lisp code and give eatch attribute tag number to join with line , to zoom center to each block (by given number), so I can see the block numbers nearby .
Code - Auto/Visual Lisp:
[Select]
(
defun
c:fatt
(
/
ov ss i en ed an ad
)
(
while
(
not
ov
)
(
setq
ov
(
getstring
t
"
\n
ATTRIB Value To Search For: "
)
)
)
(
and
(
setq
ss
(
ssget
"X"
(
list
(
cons
0
"INSERT"
)
(
cons
66
1
)
(
if
(
getvar
"CTAB"
)
(
cons
410
(
getvar
"CTAB"
)
)
(
cons
67
(
-
1
(
getvar
"TILEMODE"
)
)
)
)
)
)
)
(
setq
i
(
sslength
ss
)
)
(
while
(
not
(
minusp
(
setq
i
(
1-
i
)
)
)
)
(
setq
en
(
ssname
ss i
)
ed
(
entget
en
)
an
(
entnext
en
)
ad
(
entget
an
)
)
(
while
(
/=
"seqend"
(
cdr
(
assoc
0
ad
)
)
)
(
if
(
=
(
strcase
ov
)
(
strcase
(
cdr
(
assoc
1
ad
)
)
)
)
(
progn
(
command
"_.zoom"
"_c"
(
cdr
(
assoc
10
ed
)
)
""
)
(
getstring
"
\n
Press Enter To Continue Searching..."
)
)
)
(
setq
an
(
entnext
an
)
ad
(
entget
an
)
)
)
)
)
(
prin1
)
)
Code - Auto/Visual Lisp:
[Select]
(
defun
c:lineat2
(
/
data AllPointnumber stop pts data i p pv pts_
)
(
vl-load-com
)
(
setq
ped
(
getvar
'peditaccept
)
)
(
setvar
'peditaccept
1
)
(
if
(
setq
AllPointnumber
nil
stop
nil
pts
nil
data
(
ssget
"_X"
(
list
'
(
0
.
"INSERT"
)
'
(
66
.
1
)
'
(
2
.
"Point,KORYFES,station,trigonom,KOKAEK,KOROT,Ktir"
)
(
cons
410
(
getvar
'Ctab
)
)
)
)
)
(
progn
(
repeat
(
setq
i
(
sslength
data
)
)
(
if
(
setq
p
(
vl-some
'
(
lambda
(
x
)
(
if
(
eq
(
vla-get-tagstring
x
)
"POINT"
)
(
list
(
vla-get-textstring
x
)
(
vlax-get
e 'Insertionpoint
)
)
)
)
(
vlax-invoke
(
setq
e
(
vlax
-
ename
->
vla-object
(
ssname
data
(
setq
i
(
1-
i
)
)
)
)
)
'GetAttributes
)
)
)
(
setq
AllPointnumber
(
cons
p AllPointnumber
)
)
)
)
(
setq
allpointnumber
(
vl
-
remove
-
if
(
function
(
lambda
(
x
)
(
eq
(
car
x
)
""
)
)
)
allpointnumber
)
)
(
setq
2bjoin
(
ssadd
)
)
(
while
(
null
Stop
)
(
setq
pv
(
getstring
"
\n
Give point number <Space to continue or Enter to finish and convert to polyline> :"
)
)
(
cond
(
(
setq
a
(
assoc
(
strcase
pv
)
AllPointnumber
)
)
(
setq
pts
(
cons
(
cadr
a
)
pts
)
pts_
(
cons
(
cadr
a
)
pts_
)
)
(
if
(
=
(
length
pts
)
2
)
(
progn
(
entmakex
(
list
(
cons
0
"LINE"
)
(
cons
10
(
car
pts
)
)
(
cons
11
(
cadr
pts
)
)
)
)
(
setq
pts
(
list
(
car
pts
)
)
)
(
ssadd
(
entlast
)
2bjoin
)
)
)
)
(
(
eq
pv
""
)
(
setq
stop
"Done"
)
)
(
(
eq
(
strcase
pv
)
"U"
)
(
entdel
(
setq
del
(
ssname
2bjoin
(
1-
(
sslength
2bjoin
)
)
)
)
)
(
ssdel
del 2bjoin
)
(
setq
pts_
(
cdr
pts_
)
pts
(
list
(
car
pts_
)
)
)
)
(
(
null
a
)
(
princ
"
\n
<<Point value not found>>"
)
)
)
)
(
initget
"Yes No"
)
(
setq
convert
(
cond
(
(
getkword
"
\n
Convert to polylines? [Yes/No] <N>: "
)
)
(
"No"
)
)
)
(
if
(
eq
"Yes"
convert
)
(
command
"_.pedit"
"_M"
2bjoin
""
"_J"
""
""
)
)
)
)
(
setvar
'peditaccept ped
)
(
princ
)
)
Thanks
Logged
kasmo
Mosquito
Posts: 10
Re: Help me to fix a code : Connect attribiute points with line by point number
«
Reply #19 on:
March 12, 2023, 01:10:27 PM »
Code - Auto/Visual Lisp:
[Select]
(
defun
c:lineat2
(
/
data AllPointnumber stop pts data i p pv pts_
)
(
vl-load-com
)
(
setq
ped
(
getvar
'peditaccept
)
)
(
setvar
'peditaccept
1
)
(
if
(
setq
AllPointnumber
nil
stop
nil
pts
nil
data
(
ssget
"_X"
(
list
'
(
0
.
"INSERT"
)
'
(
66
.
1
)
'
(
2
.
"Point,KORYFES,station,trigonom,KOKAEK,KOROT,Ktir"
)
(
cons
410
(
getvar
'Ctab
)
)
)
)
)
(
progn
(
repeat
(
setq
i
(
sslength
data
)
)
(
if
(
setq
p
(
vl-some
'
(
lambda
(
x
)
(
if
(
eq
(
vla-get-tagstring
x
)
"POINT"
)
(
list
(
vla-get-textstring
x
)
(
vlax-get
e 'Insertionpoint
)
)
)
)
(
vlax-invoke
(
setq
e
(
vlax
-
ename
->
vla-object
(
ssname
data
(
setq
i
(
1-
i
)
)
)
)
)
'GetAttributes
)
)
)
(
setq
AllPointnumber
(
cons
p AllPointnumber
)
)
)
)
(
setq
allpointnumber
(
vl
-
remove
-
if
(
function
(
lambda
(
x
)
(
eq
(
car
x
)
""
)
)
)
allpointnumber
)
)
(
setq
2bjoin
(
ssadd
)
)
(
while
(
null
Stop
)
(
setq
pv
(
getstring
"
\n
Give point number <Space to continue or Enter to finish and convert to polyline> :"
)
)
(
cond
(
(
setq
a
(
assoc
(
strcase
pv
)
AllPointnumber
)
)
(
setq
pts
(
cons
(
cadr
a
)
pts
)
pts_
(
cons
(
cadr
a
)
pts_
)
)
(
command
"_zoom"
"_c"
(
car
pts
)
20
)
(
if
(
=
(
length
pts
)
2
)
(
progn
(
entmakex
(
list
(
cons
0
"LINE"
)
(
cons
10
(
car
pts
)
)
(
cons
11
(
cadr
pts
)
)
)
)
(
setq
pts
(
list
(
car
pts
)
)
)
(
ssadd
(
entlast
)
2bjoin
)
)
)
)
(
(
eq
pv
""
)
(
setq
stop
"Done"
)
)
(
(
eq
(
strcase
pv
)
"U"
)
(
entdel
(
setq
del
(
ssname
2bjoin
(
1-
(
sslength
2bjoin
)
)
)
)
)
(
ssdel
del 2bjoin
)
(
setq
pts_
(
cdr
pts_
)
pts
(
list
(
car
pts_
)
)
)
)
(
(
null
a
)
(
princ
"
\n
<<Point value not found>>"
)
)
)
)
(
initget
"Yes No"
)
(
setq
convert
(
cond
(
(
getkword
"
\n
Convert to polylines? [Yes/No] <N>: "
)
)
(
"No"
)
)
)
(
if
(
eq
"Yes"
convert
)
(
command
"_.pedit"
"_M"
2bjoin
""
"_J"
""
""
)
)
)
)
(
setvar
'peditaccept ped
)
(
princ
)
)
Logged
mhy3sx
Newt
Posts: 26
Re: Help me to fix a code : Connect attribiute points with line by point number
«
Reply #20 on:
March 12, 2023, 02:15:19 PM »
Thank you
kasmo
Logged
Print
Pages:
1
[
2
]
All
|
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Help me to fix a code : Connect attribiute points with line by point number