Intersection point

Intersection point

Anonymous
Not applicable
2,271 Views
6 Replies
Message 1 of 7

Intersection point

Anonymous
Not applicable

 I have a block contains only one polyline. These blocks are placed over an arc. I need to take the insertion point of the blocks and the arc. Is the any way. 

 

I have tried

(vla-intersectwith obj1 obj2 acExtendNone). It gives the intersection point when rotation angle of the block is Zero.

 

If the block rotation angle is changed, it returns the  list of 6 values).

(5.62 3.85 0.0 10.52 4.56 0.0) like this.

 

Please help in this issue.

 

Thanks in advance.

 

STM

0 Likes
Accepted solutions (2)
2,272 Views
6 Replies
Replies (6)
Message 2 of 7

marko_ribar
Advisor
Advisor

On your picture I see 2 arcs... Are you sure you haven't placed those 2 arcs in singe block like you did with single pline? Then you called 'intersectwith method with references of 2 blocks - one with single pline and one with 2 arcs - result is quite normal - when rotated pline is intersecting 2 arcs in 2 points - 6 numbers present 6 coordinates of 2 intersection points - first 3 - first point and last 3 - second point...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 3 of 7

Anonymous
Not applicable

Hi marko

            Thanks for your reply. It Returns the 6 values list for one arc only. Please refer the attachment.

 

STM

0 Likes
Message 4 of 7

marko_ribar
Advisor
Advisor
Accepted solution

I've checked once again, and discard what I've stated in previous post... Those 2 points are intersection points of bounding box of rotated block - and this bounding box is actually bounding box of bounding box of original block with rotation 0.0 that have been rotated along with block... If you're searching for intersection of just pline and arc, I am afraid that you have to EXPLODE block with pline - get pline as reference entity for 'intersectwith method with (vlax-ename->vla-object (ssname (ssget "_P") 0)) and then when you get single point of intersection perform "UNDO" command - I'd suggest if you want to get points of all blocks - you iterate and in each iteration you use (command "_.EXPLODE" blref) => you get intersection point => you put it in a list with (setq ipl (cons ip ipl)) and then use (command "_.UNDO" "1") => next iteration of loop...

 

It wasn't clear and to me until I didn't checked... Yes you had block and single arc as references for intersectwith method...

Regards, M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
Message 5 of 7

Kent1Cooper
Consultant
Consultant
Accepted solution

You don't say what Obj3 is the VLA-object version of, exactly, but if you are trying to use it in the IntersectWith method, I suspect it must be of the nested Polyline [for example, selected via (nentsel)], and not the Block itself.  If so, that would explain a different result when the Block rotation is other than zero, because information about nested objects is stored not in terms of the resultant location and size and rotation of the nested object as part of the Block insertion, but in relation to the Block's defined insertion point at 0 rotation and scale factors of 1.

 

Simple demonstration of this:  Draw a Circle, and define a Block whose insertion point is the center of the Circle and that contains only the Circle.  Insert that Block in various different locations.  Then look at the center of the Circle in any such Block, with:

 

(cdr (assoc 10 (entget (car (nentsel)))))

 

[and pick on one], and it will be 0,0,0 in all of them, regardless of where the Block is inserted, because the center of the Circle is at the Block's insertion point, that is, at 0,0,0 in relation to that.

 

If Obj3 is of the Block itself, I wasn't aware that you can use IntersectWith with a Block, but if so, see marko_ribar's explanation.

 

Do they need to be Blocks?  [Also, Do the contents of the Blocks need to be Polylines rather than just Lines?]

Kent Cooper, AIA
Message 6 of 7

Anonymous
Not applicable

Hi Marko

              Thanks for the logic and i have checked that. It works. Thanks Once again.

 

STM

0 Likes
Message 7 of 7

Anonymous
Not applicable

Hi Kent Cooper,

           I need it has to be block and thanks for giving the other options.

 

Thank u Masters....

 

STM

0 Likes