Author Topic: closed area offset problem  (Read 3206 times)

0 Members and 1 Guest are viewing this topic.

taner

  • Guest
closed area offset problem
« on: April 10, 2008, 01:26:36 AM »
Can any one try it? See the attached file.
« Last Edit: April 10, 2008, 04:52:17 AM by taner »

cjw

  • Guest
Re: closed area offset problem
« Reply #1 on: April 10, 2008, 04:10:05 AM »
What's the version of the dwg? I can't open it.
Can CAD2006?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: closed area offset problem
« Reply #2 on: April 10, 2008, 09:02:04 AM »
Welcome to TheSwamp cjw.
The DWG is Rev 14.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

daron

  • Guest
Re: closed area offset problem
« Reply #3 on: April 10, 2008, 09:49:49 AM »
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?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: closed area offset problem
« Reply #4 on: April 10, 2008, 09:50:50 AM »
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.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

qjchen

  • Bull Frog
  • Posts: 285
  • Best wishes to all
Re: closed area offset problem
« Reply #5 on: April 10, 2008, 11:20:07 AM »
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 :)

http://qjchen.mjtd.com
My blog http://chenqj.blogspot.com (Chinese, can be translate into English)

daron

  • Guest
Re: closed area offset problem
« Reply #6 on: April 10, 2008, 12:02:27 PM »
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?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: closed area offset problem
« Reply #7 on: April 10, 2008, 07:32:00 PM »
taner,
You can use this for a "One at a time" solution.
Code: [Select]
(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.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

cjw

  • Guest
Re: closed area offset problem
« Reply #8 on: April 11, 2008, 02:29:53 AM »
Thanks CAB.
Can just select once to finish it.use the "ssget"?
very happy i am here.change the code :-)
Code: [Select]
(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)
)

« Last Edit: April 11, 2008, 02:36:05 AM by cjw »

taner

  • Guest
Re: closed area offset problem
« Reply #9 on: April 11, 2008, 02:33:12 AM »
the solution step by step i have already tried.

taner

  • Guest
Re: closed area offset problem
« Reply #10 on: April 11, 2008, 07:37:46 PM »
taner,
You can use this for a "One at a time" solution.
Code: [Select]
(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.