Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Delete offset line

5 REPLIES 5
Reply
Message 1 of 6
shehab10
2497 Views, 5 Replies

Delete offset line

Hi every one , There are many lisp that draw offset line but what about opposite way , I have wall of double line i need to delete one of them let's say inside wall line .

why i need to do this usually when i tracing in external programme like autocad architecture or Revit or archicad  i just need outline of exterior and interior walls !.

is there way that can delete the offset line  ?(or within range predefined in lisp to prevent interferring of lines deletion).

 

Thanks in advance,

Regards,

5 REPLIES 5
Message 2 of 6
Kent1Cooper
in reply to: shehab10


@shehab10 wrote:

.... I have wall of double line i need to delete one of them let's say inside wall line .

... when i tracing in external programme ... i just need outline of exterior and interior walls !.

is there way that can delete the offset line  ?(or within range predefined in lisp to prevent interferring of lines deletion).

....


Without seeing something like a drawing or image showing what you have to begin with, and what you want to have afterwards, it's a little hard to say.

 

Are you thinking of selecting, for example, an entire area of a drawing and having it get rid of one Line in any pair that are parallel and on the same Layer and within a certain distance of each other?  It's hard to imagine how a routine could decide which of a given pair you want.  Maybe there would be some calculable possibilities such as the exterior perimeter [e.g. delete the one closer to or farther from the "center of gravity" of the whole area].  But for something like interior partitions, I would expect that even with a routine, there would be so much to do in selecting things, and designating something like on which side of two parallel Lines is the one you want to delete, that just using Erase and picking them might be as easy.

Kent Cooper, AIA
Message 3 of 6
scot-65
in reply to: Kent1Cooper

I can think of a sequence as follows:
Select the line or lines one will want to keep.
[Enter]
Window the lines that will go away, and it will be OK if the lines one wants to keep in step one is included in this selection set.
[Enter]

I have worked a Revit converted drawing and it is an absolute mess to clean up. For instance, each copy of a block now becomes a unique block - where updating one block will not apply to the other blocks.

Back at the OP - Cleaning up was accomplished by moving the desired line to a layer that is frozen. AutoCAD/Express has a tool for this, but an alert dialog always appears telling you that object will be moved to a frozen layer. I have my own tool for this that does not annoy the user.

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 4 of 6
shehab10
in reply to: Kent1Cooper

To be more specific in my question i illustrated before and after delete offset in the attachment,

Yes i need routine that either will get offset value from user to delete or 

predefined in lisp by valuse like 200 mm or by range anyway of this ?

the direction prompt also is desired in the lisp to determine which direction will be deleted,

anyone has this challenge to do this lisp  ?

 

Message 5 of 6
Kent1Cooper
in reply to: scot-65


@scot-65 wrote:
I can think of a sequence as follows:
Select the line or lines one will want to keep.
[Enter]
Window the lines that will go away, and it will be OK if the lines one wants to keep in step one is included in this selection set.
[Enter]
....

For that, no routine is necessary, if you're willing to reverse the order of the steps.  You can just start Erase, window the area, then go into the Remove option to take the ones you want to keep out of the selection.  If you want to limit the initial windowed-area selection to Line entities only, that can also be done without any routine, using Qselect.

 

But in the case of parallel Lines in which you want to remove one of each pair [basically -- it's slightly different from that in some spots in the OP's sample image], if it requires you to go around and pick one of each pair to keep, you may as well skip any routine and just go around and pick one of each pair to remove, in an ordinary Erase command.

Kent Cooper, AIA
Message 6 of 6
Kent1Cooper
in reply to: shehab10


@shehab10 wrote:

To be more specific in my question i illustrated before and after delete offset in the attachment,

Yes i need routine that either will get offset value from user to delete or 

predefined in lisp by valuse like 200 mm or by range anyway of this ?

the direction prompt also is desired in the lisp to determine which direction will be deleted,

anyone has this challenge to do this lisp  ?

 


Your illustration doesn't really conform to your description.  If you specify which side of each pair of parallel Lines to delete, presumably that would be something like "delete the upper ones in horizontal pairs and the left ones in vertical pairs" [two designations required, not to mention the issue of non-orthogonal Lines].  But in your example, for horizontal pairs you removed some upper ones and some lower ones, and for vertical pairs, some left ones and some right ones.  If it's not to be the same side in all pairs running in the same direction, then you're going to be stuck with selecting which side for every pair, in which case you may as well just use Erase and select one Line of each pair, whether in initial selection, or with a Windowed selection and using the Remove option to select the ones you want to keep.

 

You also removed both of many pairs of parallel Lines, at the door jambs [except for one -- I assume that wasn't intentional].  I suppose a routine could conceivably determine that two Lines are parallel and aligned in that way and the same length [possibly a specified length only, or within a limited range], and in that situation remove both.  But I can imagine that kind of evaluation might decide to delete some pairs that you don't want it to.

 

In my first reply I mentioned that the exterior perimeter might be handled by finding which of a pair is closer to the overall "center of gravity," and delete that one.  But in your example, the roughtly-mid-line vertical wall is closer to the overall right side than to the left, so that kind of evaluation would decide to delete the left-side Line, which is the exterior one that you want to keep.

 

Further complications....  Consider the roughtly-mid-line horizontal wall.  It's made of five Lines, of which you are keeping two and deleting three, removing one Line related to the left-end LIne that you keep, but removing two Lines related to the right-end Line that you keep.  So it's not just removing one Line of each pair of parallel Lines.

 

And AutoCAD has no way of knowing that Lines have any geometrical relationship except by doing a bunch of calculations based on their endpoints and the relation between them.  A routine would need to compare every Line in an overall selection with every other Line.  That could be a huge number of comparisons.

 

If you were only deleting one of each pair of Lines that are parallel and within a certain range of distance from each other and aligned with each other in Offset-like fashion, I could almost image a routine figuring out which pairs of Lines "match" in a way that means one of them should be deleted.  But since so many are trimmed or broken or filleted, at corners and intersections, that kind of evaluation can't do it for you.  You can't even count on one end of each pair aligning, and [for instance] deleting the shorter one [I can picture situations in which that wouldn't be an appropriate comparison, though maybe your example doesn't contain any].

 

It just seems like an extraordinarily complicated thing to accomplish, if it's even possible in a way that wouldn't be just as much work for the User as ordinary Erase.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost