vla-IntersectWith question

Hmmm...The code below only works when I select lines. I get an automation error with all other entity types I have tried. Can anyone see what I am doing wrong?Thanks,GregCode:

;;; Basic test of IntersectWith(defun c:g1 ( / obj1 obj2 int_pts) ; select entities (setq obj1 (car (entsel)) obj2 (car (entsel))) ; convert to vla-objects (setq obj1 (vlax-ename->vla-object obj1) obj2 (vlax-ename->vla-object obj2)) ; find intersections of objects using vla-intersectwith ; option 0 means extend neither ; option 1 means extend this ; option 2 means extend other ; option 3 means extend both int_pts (vla-intersectwith obj1 obj2 0))

The errors I get look like this:An error has occurred: Automation Error 80020009; Error accessing [INTERSECTWITH] method. ErrIndex=0

Comments

  • Ok, I tried this out on another system with a different cad package and it seems to work.... off to a support request I guess ...

  • returns Select entity: # in the latest beta

  • Oops, that didn’t work, returns #[variant 8197 ...] in the latest beta

  • Dear Greg, Dear Daniel,currently, the COM function "IntersectWidth()" is only available for LINE entities; for all other linear entities it is not yet implemeneted ... maybe, for ARCs and CIRCLEs it is working as well, but not for most others.This functionality will be completed when the new geometric library is fully integrated.Many greetings

  •  I get an error using the above routine on blocks (ver# 12.1.13)

    Just was wondering if anyone could shed some light on a solution?

  • @Richard: That function was a very simple test to demonstrate a problem I was having. IntersectWith is supported with many more entity types now. If you want to use an entity from a block insert then look into using nentsel to select it. If you want intersections with the bounding box containing the insert perhaps you can make use of GetBoudingBox method of the object.

    Hope it helps...
This discussion has been closed.