Jump to content

Trim/extend conditionally


samifox

Recommended Posts

Hi All

 

major amount of my autocad work is to offset a line inward, move the offseted line to its own layer and trim-extend the offseted line.

 

im looking a way to autolisping it out,

see the attached image

 

1.offset the selected poly 3 units

2.select the offseted lines

3.move them to x layer

4.

if - white lines are far

if - white lines are far> 3 of green lines so trim it 3 units

 

or something...

 

competing this willsave lots of lots of time

GOD BLESS

 

Thanks

Shay

trim-extend.jpg

Link to comment
Share on other sites

If you create polylines from the green contours, then by offsetting them, will get a contour that doesn't require additional fixings.

Link to comment
Share on other sites

hi

 

totaly wrong :x !

 

i post that image becuase i didnt want pepole to imagin :)

 

see in the image whats hapaning only with offseting the polyline and compare it to my original post

 

Thanks

Shay

trim.jpg

Link to comment
Share on other sites

totaly wrong :x !
No, not wrong. MSasu is 100% correct. If you use a POLYLINE instead of LINE to create the green lines first, when you offset, it'll generate the exact contour of the white polylines, and the OFFSET command already has an option to put the offsetting objects to any layer you choose.

 

Give it a shot and see for yourself. :)

Link to comment
Share on other sites

MSasu IS right in what he says, but unfortunately is not exactly what the OP requires, although it is a good start.

 

The OP's picture looks like wall reinforcement, which needs odd lengths for bond, where a U-bend is not practicable (or something like that).

Link to comment
Share on other sites

Probably 12 times the bar diameter or 6", whichever is the greater :unsure:

 

Maybe you're right. Your guess is as good as mine eldon :D

Rebars is all greek to me. :)

Link to comment
Share on other sites

You can do this but it will involve some detailed and carefully organized coding. As I see it, when you offset the green polylines you will end up with what MSasu outlines. Then you could explode the offset polylines to get individual lines to work with. You would then have a lot of complex coding to do to work this out, but it could be done.

 

If it were me, I'd try to approach it from this angle. Since you draw the polylines in the first place, you know the coordinates of the end points. Placing those coordinates into an array you could loop through them to construct the white lines as needed. Again, I'm just looking at this for the first time, but like all things with LISP, if you can draw it, you can usually program it to be drawn. As each white line is drawn you would of course be adding or subtracting the offset dimension (in this case 3) from the one or more of the coordinates of the end points. I apologize that I cannot post code to do this, but I believe it could be done like this. And, as always, there is usually more than one way of accomplishing this.

 

My next approach would be, do the green lines need to be polylines in the first place? If not, then offsetting them and then extending and trimming them would be much easier. In the end you end up with the same view, but the green lines would be individual lines, not polylines.

Link to comment
Share on other sites

Hay people J

 

The O key in my keyboard is all broken. 2 years ofoffseteting and extending lines for reinforcement rebars( Sorry I didt mentionit was rebars, I didn’t thing its relevant at all)

Ok…so storing the coordinates in an array and construct therebars line as needed, does it mean that you ignoring the trim-extend command totally?Interesting approach. You got it out of the box.

You made me think that using polar() and line command withina lisp can be a solution , right?

 

Obviousl, my LISP skills cannot afford it now. Im sure lotsof drafters (with messy O key like me) would be happy to have that lisp.

 

Thanks

Shay

Link to comment
Share on other sites

Looking at it a second time, there wouldn't be the need to store the coordinates in an array, although that too would work. But since you know the coordinates of the intersections of the green lines you could easily use polar coordinates to draw the white lines. I realize this is probably over simplification. One would have to actually start building the program to do this. I use polar coordinates to draw lots of objects with LISP. My 'O' key is intact though.

Link to comment
Share on other sites

common gurus... i hardly able to draw a simple line with lisp. for you guys is POC....it will help me a lot. again need a lisp to create rebars (as seen in my original post)

 

Thanks

Shay

Link to comment
Share on other sites

Have you looked at RebarCAD?

 

It seems that you want a member of the Forum to provide you with a FREE rebar lisp. Search the web first, you may find something already there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...