TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: taner on April 10, 2008, 01:26:36 AM
-
Can any one try it? See the attached file.
-
What's the version of the dwg? I can't open it.
Can CAD2006?
-
Welcome to TheSwamp cjw.
The DWG is Rev 14.
-
That'd be a trick to get them all to look like that at once, but to allow the user to pick which one's are desired is doable. Does it have to be readable by R14?
-
Look at this:
http://www.theswamp.org/index.php?topic=10371.msg132038#msg132038
and this:
(command "boundary" "A" "I" "Y" "O" "P" "" (getpoint) "")
I would create boundaries, use vla offset to offset on both sides. Test the new objects
and delete the on with the greater area.
-
In this article,
http://www.xdcad.net/forum/showthread.php?s=80b0c21ee3740e946d140d63b2e4ecdd&threadid=571446
the second post, Kuangdao present such an idea.
First , break all the line at the intersection, then, use region command, select all entities ,it will generate many little region by close area.
So, Fisrt, use CAB's break all line at once, then , use region , and then offset each little region :)
-
That's one way, but you still need user interaction to remove the regions that shouldn't be included. Look closely. Every other square is offset, not all of them. If it's only doable by R14 standards a simple command call could be set up. If it's > R14, some more tools can be used. What if the user doesn't want them broken?
-
taner,
You can use this for a "One at a time" solution.
(defun c:test (/ dist layname pt ent)
(setq dist 2.0
LayName "COMD"
)
(while (setq pt (getpoint "\nPick an internal point."))
(command "._undo" "_begin")
(command "._boundary" "A" "I" "Y" "O" "P" "" "non" pt "")
(setq ent (entlast))
(command "_.offset" dist ent "non" pt "")
(command "._CHANGE" "L" "" "P" "LA" LayName "")
(entdel ent)
(command "._undo" "_end")
)
(princ)
)
Note that there is no error checking & that for it to work the entire space being offset must be on the screen.
-
Thanks CAB.
Can just select once to finish it.use the "ssget"?
very happy i am here.change the code :-)
(defun c:test (/ dist ename layname pt)
(setq dist 2.0
layname "comd"
)
(while (setq pt (getpoint "\npick an internal point."))
(command "._undo" "_begin")
(setq ename (bpoly pt))
(command "_.offset" dist ename "non" pt "")
(command "._change" "l" "" "p" "la" layname "")
(entdel ename)
(command "._undo" "_end")
)
(princ)
)
-
the solution step by step i have already tried.
-
taner,
You can use this for a "One at a time" solution.
(defun c:test (/ dist layname pt ent)
(setq dist 2.0
LayName "COMD"
)
(while (setq pt (getpoint "\nPick an internal point."))
(command "._undo" "_begin")
(command "._boundary" "A" "I" "Y" "O" "P" "" "non" pt "")
(setq ent (entlast))
(command "_.offset" dist ent "non" pt "")
(command "._CHANGE" "L" "" "P" "LA" LayName "")
(entdel ent)
(command "._undo" "_end")
)
(princ)
)
Note that there is no error checking & that for it to work the entire space being offset must be on the screen.
Dear Cab,
sometime two or more entities will be made when offset.