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)
»
XDRX-API
»
Topic:
[XDrX-PlugIn(23)] Rebuild Hatch Boundary (4 methods)
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: [XDrX-PlugIn(23)] Rebuild Hatch Boundary (4 methods) (Read 991 times)
0 Members and 1 Guest are viewing this topic.
xdcad
Swamp Rat
Posts: 514
WWW
[XDrX-PlugIn(23)] Rebuild Hatch Boundary (4 methods)
«
on:
December 01, 2023, 09:18:24 PM »
the first method:
Convert Hatch to MPolygon, then convert MPolygon back to Hatch
Code - Auto/Visual Lisp:
[Select]
(
defun
c:tt
(
)
(
if
(
setq
ss
(
xdrx
-
ssget
"
\n
Select Hatch to Rebuild the Boundary <Exit>:"
'
(
(
0
.
"hatch"
)
)
)
)
(
progn
(
xdrx
-
begin
)
(
setq
nums
(
sslength
ss
)
)
(
mapcar
'
(
lambda
(
x
)
(
setq
mp
(
xdrx
-
hatch
->
mpolygon x
)
ha
(
xdrx
-
mpolygon
->
hatch mp
)
)
(
xdrx
-
entity
-
matchprop x ha
)
(
setq
ha
(
xdrx
-
ss
-
getsub ha '
(
(
0
.
"hatch"
)
)
)
ha1
(
ssname
ha
0
)
)
(
xdrx
-
object
-
swapid x ha1
)
(
xdrx
-
entity
-
delete ha1
)
(
xdrx
-
entity
-
setcolor
(
xdrx
-
getpropertyvalue x
"assocobjids"
)
7
)
)
(
xdrx
-
ss
->
ents ss
)
)
(
xdrx
-
prompt
"
\n
Successfully Created "
nums
" Hatch Boundary."
)
(
xdrx
-
end
)
)
)
(
princ
)
)
«
Last Edit: December 01, 2023, 10:47:29 PM by xdcad
»
Logged
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net
xdcad
Swamp Rat
Posts: 514
WWW
Re: [XDrX-PlugIn(23)] Rebuild Hatch Boundary
«
Reply #1 on:
December 01, 2023, 09:55:47 PM »
the second method:
1.make hatch
2. append loop to Hatch
3. The Loop is Assoc to Hatch
Code - Auto/Visual Lisp:
[Select]
(
defun
c:tt
(
)
(
if
(
setq
ss
(
xdrx
-
ssget
"
\n
Select Hatch to Rebuild the Boundary <Exit>:"
'
(
(
0
.
"hatch"
)
)
)
)
(
progn
(
xdrx
-
begin
)
(
setq
nums
(
sslength
ss
)
)
(
mapcar
'
(
lambda
(
x
)
(
setq
loops
(
xdrx
-
getpropertyvalue x
"getloops"
)
)
;;Get Hatch ALL Loops
(
setq
ha
(
xdrx
-
hatch
-
make
)
;;Make a Memory Hatch
ha
(
xdrx
-
entity
-
make ha
)
;;Create to Database
)
(
mapcar
'
(
lambda
(
loop
)
(
setq
e
(
xdrx
-
entity
-
make loop
)
)
;;Create Loop Curve To Database
(
xdrx
-
setpropertyvalue ha
"appendloop"
(
list
0
e
)
)
;;Append Loop To Hatch
(
xdrx
-
entity
-
setcolor e
7
)
)
loops
)
(
xdrx
-
entity
-
matchprop x ha
)
(
xdrx
-
object
-
swapid x ha
)
;Exchange Objectid,ensure EntityName Not Change
(
xdrx
-
entity
-
delete ha
)
(
xdrx
-
setpropertyvalue ha
"removeloopat"
0
)
)
(
xdrx
-
ss
->
ents ss
)
)
(
xdrx
-
prompt
"
\n
Successfully Created "
nums
" Hatch Boundary."
)
(
xdrx
-
end
)
)
)
(
princ
)
)
«
Last Edit: December 01, 2023, 10:17:38 PM by xdcad
»
Logged
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net
xdcad
Swamp Rat
Posts: 514
WWW
Re: [XDrX-PlugIn(23)] Rebuild Hatch Boundary
«
Reply #2 on:
December 01, 2023, 10:10:52 PM »
Third method:
1. Extract HATCH LOOP information,
2. Directly generate LOOP curves
3. In this way, the boundary and HATCH are not Assoc
Code - Auto/Visual Lisp:
[Select]
(
defun
c:tt
(
)
(
if
(
setq
ss
(
xdrx
-
ssget
"
\n
Select Hatch to Rebuild the Boundary <Exit>:"
'
(
(
0
.
"hatch"
)
)
)
)
(
progn
(
xdrx
-
begin
)
(
setq
nums
(
sslength
ss
)
)
(
mapcar
'
(
lambda
(
x
)
(
setq
loops
(
xdrx
-
getpropertyvalue x
"getloops"
)
)
;;Get Hatch ALL Loops(AcGe)
(
setq
e
(
xdrx
-
entity
-
make loops
)
)
;Create Loops urve To Database
(
xdrx
-
entity
-
setcolor e
7
)
)
(
xdrx
-
ss
->
ents ss
)
)
(
xdrx
-
prompt
"
\n
Successfully Created "
nums
" Hatch Boundary."
)
(
xdrx
-
end
)
)
)
(
princ
)
)
Logged
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net
xdcad
Swamp Rat
Posts: 514
WWW
Re: [XDrX-PlugIn(23)] Rebuild Hatch Boundary
«
Reply #3 on:
December 01, 2023, 10:45:00 PM »
Method 4
1. Get all LOOPS of the filled entity
2. Use the function (xdrx-hatch-make loops) to directly generate it once
3.loop is assoc
Code - Auto/Visual Lisp:
[Select]
(
defun
c:tt
(
)
(
if
(
setq
ss
(
xdrx
-
ssget
"
\n
Select Hatch to Rebuild the Boundary <Exit>:"
'
(
(
0
.
"hatch"
)
)
)
)
(
progn
(
xdrx
-
begin
)
(
setq
nums
(
sslength
ss
)
)
(
mapcar
'
(
lambda
(
x
)
(
if
(
and
(
setq
loops
(
xdrx
-
getpropertyvalue x
"getloops"
)
)
;;Get Hatch ALL Loops(AcGe)
(
setq
e
(
xdrx
-
entity
-
make loops
)
)
(
setq
ha
(
xdrx
-
hatch
-
make e
)
)
)
(
progn
(
setq
ha
(
xdrx
-
ss
-
getsub ha '
(
(
0
.
"hatch"
)
)
)
)
(
xdrx
-
entity
-
matchprop x ha
)
(
xdrx
-
object
-
swapid x
(
ssname
ha
0
)
)
(
xdrx
-
entity
-
delete ha
)
)
)
)
(
xdrx
-
ss
->
ents ss
)
)
(
xdrx
-
prompt
"
\n
Successfully Created "
nums
" Hatch Boundary."
)
(
xdrx
-
end
)
)
)
(
princ
)
)
Logged
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net
xdcad
Swamp Rat
Posts: 514
WWW
Re: [XDrX-PlugIn(23)] Rebuild Hatch Boundary
«
Reply #4 on:
December 01, 2023, 10:46:53 PM »
Method 5
1.root loop creation and filling
2. Get all internal LOOPs
3. Use xdrx-get-intersect to find the intersect of HATCH and internal boundaries.
................
Logged
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
XDRX-API
»
Topic:
[XDrX-PlugIn(23)] Rebuild Hatch Boundary (4 methods)