NEED A LISP FOR A OBJCET IS ALIGNED TO LINE OR NOT...

NEED A LISP FOR A OBJCET IS ALIGNED TO LINE OR NOT...

archana96
Enthusiast Enthusiast
816 Views
10 Replies
Message 1 of 11

NEED A LISP FOR A OBJCET IS ALIGNED TO LINE OR NOT...

archana96
Enthusiast
Enthusiast

HI GUYS I HAVE A PROBLEM WITH ALIGNING OBJECTS SAME LINE.. SOMETIMES IT'S NOT ALIGNED BUT IT SHOWS LIKE SAME ALIGNMENT. 

0 Likes
817 Views
10 Replies
Replies (10)
Message 2 of 11

-didier-
Advisor
Advisor

Bonjour @archana96 

 

You do not say enough in your question to be effectively assisted.
What kind of object?
And aligned that what kind of object?
It is very different from aligning a line on a line or aligning a block (geometry?) on a polyline with multiple vertices.

 

Amicalement

Éternel débutant.. my site for learning : Programmer dans AutoCAD

DA

EESignature

0 Likes
Message 3 of 11

Kent1Cooper
Consultant
Consultant

If you are talking about two straight things, and you want to know whether or not they are aligned in the same direction, i.e. whether or not they are parallel, one thing you can do is to use the BI command defined in BISECTOR.lsp, >here<, and pick on the two objects.  It will draw an XLINE BIsecting the angle between them if they are not parallel, and if they are parallel, it will draw it halfway between them and parallel to both, and it will tell you they're parallel and that it's doing that.  So that can be your "report" that they are aligned in the same direction.  It works on top-level and nested objects, so for example, if you want to check whether a Block is aligned with a Polyline line segment, if there's a piece of the Block that runs in the direction you want to check, you can pick on that nested object and on the relevant segment of the Polyline.

 

[Of course the parts of the command that determine whether things are parallel could be pulled out into a simpler command that would report on that, without drawing the XLINE.]

 

If that's not what you mean by the "aligned or not" question, explain in more detail.  [For example, not just aligned in direction, but also coinciding as you could make them do with an ALIGN command?]

Kent Cooper, AIA
0 Likes
Message 4 of 11

-didier-
Advisor
Advisor

Bonjour

 

I think we have to wait for  @archana96 to answer us by sending us an example (dwg) in which we will see the actions to be carried out.
Please put in the two cases, one before the program, the other after.

 

Amicalement

Éternel débutant.. my site for learning : Programmer dans AutoCAD

DA

EESignature

0 Likes
Message 5 of 11

Kent1Cooper
Consultant
Consultant

@-didier- wrote:

....  @archana96 .... Please put in the two cases, one before the program, the other after.


That's part of what we need more explanation about: There may be no "after" that's any different from "before," if all they want is to know whether something is "ALIGNED TO LINE OR NOT."  That "OR NOT" wording sounds to me like maybe they want only a "status report," but not necessarily to change anything.

Kent Cooper, AIA
0 Likes
Message 6 of 11

archana96
Enthusiast
Enthusiast

for your reference, i attached the file 

0 Likes
Message 7 of 11

Sea-Haven
Mentor
Mentor

This is like a pre start to this  https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-dimensions-for-all-poly-lines-wi...

 

The internal objects are plines and hatch so why have you not used a lisp to make sure they are drawn correct, refer also the the other dwg "Work1" where the objects are not aligned to an edge but can be offset in 2 directions. Picking lines gets there angle so making rectangs is correct.

0 Likes
Message 8 of 11

archana96
Enthusiast
Enthusiast

i have many rectangular   for  checking taking too much of time. for fast work i need a lisp so please help sir, 

0 Likes
Message 9 of 11

Kent1Cooper
Consultant
Consultant

Given that you are starting with the objects but not the alignment lines, I see a potential problem.  Exaggerating the difference for illustration, in a vertical-position comparison:

Kent1Cooper_0-1737724886341.png

If you have two at one level and two at another, how can a routine decide which two are at the correct alignment and which two are off?  Should the yellow line become your red line, and should the objects that touch the magenta line be flagged as being misaligned, or the other way around?

Kent Cooper, AIA
0 Likes
Message 10 of 11

archana96
Enthusiast
Enthusiast

I only check with one line. if the rectangular is touched pallor to  the line it's ok, if any object is not touched or over crossed the line needs to show the different color 

0 Likes
Message 11 of 11

Kent1Cooper
Consultant
Consultant

@archana96 wrote:

I only check with one line. .... 


Does that mean that the lines to check against exist in the drawing already?  They are not in the "before" part of your sample drawing.

Kent Cooper, AIA
0 Likes