Extend an object by selection single object and target this object

Extend an object by selection single object and target this object

Anonymous
Not applicable
1,028 Views
6 Replies
Message 1 of 7

Extend an object by selection single object and target this object

Anonymous
Not applicable

Hi every one. 

 

Im a drafter. i have been using autcad for nearly two years.

there is a problem. i really need hepl to make an autolisp to extend an object like a line, rectangle, polyline within selection then pick a point after that those objects will be aligned to the point i have just picked at. it is kind of the same command line STRETCH in autocad but with this autolisp i can select single objects. Could you pleased see the refer video with the link here https://www.youtube.com/watch?v=aD3rN5eUInA&feature=youtu.be.

 

Thanks in advanced.!

0 Likes
1,029 Views
6 Replies
Replies (6)
Message 2 of 7

CodeDing
Advisor
Advisor

@Anonymous,

 

The video you link shows somebody using the STRETCH command. The stretch command can be used for multiple objects. It's Is what you want? Something different? Please elaborate.

 

Best,

~DD

Message 3 of 7

john.uhden
Mentor
Mentor

I didn't look at your link, but I think I see a problem with your goal.  One must extend an object to a boundary, not just one point.  Now it may be possible to extend a line to a zero-length target line (both ends are at the same singular point), but probably only if the target lies on the exact path of the line to be  extended.  I haven't tried it, but only because I would have no need for such usage.

Many of us here use the vla-intersectwith method, which allows for extending none, one, or both of the objects, but a zero length line has no direction for it to be extended to find the point of apparent intersection.

John F. Uhden

Message 4 of 7

doaiena
Collaborator
Collaborator

If i understand you right, you want a stretch command that uses a pickbox, instead of a window selection mode. Such a command will not work because with a pickbox you are selecting the entity as a whole. You aren't telling AutoCAD, the point you wish to stretch from. There is not enough information to complete the command. Stretching a simple rectangle, line or "L" shaped polyline, may seem intuitive to a human for the given context, but the computer needs a specific point from which to stretch the entity. In more complex cases, like a "Z" shaped polyline, AutoCAD wouldn't know which part of the entity you want to stretch and which part you want to move. That is why the stretch command uses a window selection. It gives AutoCAD an exact point from which to execute the command, an entity and parts of an entity to move.

Message 5 of 7

john.uhden
Mentor
Mentor

That's an interesting way of putting it.  It took me years to conclude that AutoCAD is looking for individual points (parts of an object) to relocate, unlike the move command which will relocate the entire object.  Come to think of it, I have never written anything that uses (command "_.stretch" ...), but I use the stretch command a lot at work.  I design the panels that when seamed together make a vinyl swimming pool liner.  Part of the process is to apply shrinkage to the pool outline both lengthwise and widthwise.  This is to ensure that the liner is not too big, as the material will stretch into place when filled with water.  If it can't stretch it will result in wrinkles.  The stretch command allows relocating say half the polyline points without exploding, offsetting, filleting, etc.

John F. Uhden

Message 6 of 7

Anonymous
Not applicable

Thank you for spending time for my question.

 

Im sorry if i did not make my question clear.

T thought would say this at first. (I've been looking for this issue since im working with ( Revit ). in revit we can align any object with command line ( align ). Therefore, im wondering there is a way that we can make an autolisp  can do the same way Revit do).

 

Thanks in advance.!

0 Likes
Message 7 of 7

DannyNL
Advisor
Advisor

In Revit (while modelling) you don't use primitive lines, circles, etc. like in AutoCAD, but you have i.e. walls, beams, etc.. So aligning these objects by the user is easier as they are 'intelligent' objects that 'know' what they are and are constrained to their specific characteristics.

 

In AutoCAD it's different as objects are not intelligent (a line doesn't know that it is supposed to be and doesn't know what else it belongs to, only the drafter/engineer knows) and aren't constrained by default.

 

If possible, I don't think it will be an easy task to program something similar as the Revit Align for plain AutoCAD.