vla-intersectwith shortcoming

vla-intersectwith shortcoming

john.uhden
Mentor Mentor
2,081 Views
24 Replies
Message 1 of 25

vla-intersectwith shortcoming

john.uhden
Mentor
Mentor

Although Land Desktop has a routine for labeling the elevation of polyline contours, it often misbehaves.  So naturally I wrote my own.  The object is to pick the polyline at the desired label point, extract the elevation, add the text aligned with the polyline, and break the polyline from one end of the text to the other.  Sadly, 2004 doesn't have background masking, and the boss despises wipeouts, thus we must break the polyline.

My method was to create an invisible circle, find the intersects, and use them as the two break points.

After some trial and error, I have found that the method does not work when the circle intersects one bulged segment twice.  Even the native TRIM command won't work.  If one of the intersections is with a straight polyline segment, it does work.

Has anyone else experienced this behavior?  Or maybe it was a bug that's been fixed since 2004.

John F. Uhden

0 Likes
Accepted solutions (3)
2,082 Views
24 Replies
Replies (24)
Message 21 of 25

ronjonp
Mentor
Mentor
Accepted solution

@cadffm wrote:

...

the last option is to create a new object and erase the old one.

 

I will try it in a newer version, if you are not faster with your test.


@cadffm  In before me but same thought process. 🍻 

0 Likes
Message 22 of 25

john.uhden
Mentor
Mentor
Tomorrow. Gotta get gas and get home.
Many thanks, Sebastian.

John F. Uhden

0 Likes
Message 23 of 25

cadffm
Consultant
Consultant
Accepted solution

Cry

You can not remove the mask by this way (remove 90 45 63 441 & entmod), so in 2004 the only way is to re-create the Object.

In 2005-2021 it also not working by entmod, but you have vla-put-backgroundfill

 

 

Note:

You all saw and fix the issue in my basic sample code, but for beginners i post the edited code again.

 

(defun TEST (#90# #63# #45# / #el# #TEMP#) ;; TEST-> (TEST 3 9 1) or (TEST 1 4 1)
(while
(setq #el# (entget(car (nentsel "\nMtext wählen: "))))
;;================================================================
(if (assoc 90 #el#)
(setq #el# (subst (cons 90 #90#) (assoc 90 #el#) #el#))
(setq #el# (append #el# (list (cons 90 #90#))))
)
;;================================================================
(if (assoc 63 #el#)
(setq #el# (subst (cons 63 #63#) (assoc 63 #el#) #el#))
(setq #el# (append #el# (list (cons 63 #63#))))
)
;;================================================================
(if (assoc 45 #el#)
(setq #el# (subst (cons 45 #45#) (assoc 45 #el#) #el#))
(setq #el# (append #el# (list (cons 45 #45#)))) ;
)
;;================================================================
(entmod #el#)
)
)

 

Sebastian

0 Likes
Message 24 of 25

john.uhden
Mentor
Mentor

I got it (removing backgroundfill via dxf).  Yes, you have to delete the original and make a new one, because entmoding it (to remove) does not work.

(foreach dxf '(-1 5 330 90 45 63 441)(setq ent (vl-remove (assoc dxf ent) ent)))
(entdel e) ;; chuck the original
(entmake ent) ;; make a new one

I have no idea what the 441 code is for. 

Of course the original ent should include its xdata so that it is recreated.

John F. Uhden

0 Likes
Message 25 of 25

ronjonp
Mentor
Mentor

@john.uhden  

From the docs:

441

Transparency of background fill color (not implemented)

 

You see the post HERE? That solution worked for me.

0 Likes