CheckInterference Method (ActiveX) for Surfaces?

CheckInterference Method (ActiveX) for Surfaces?

surfer96
Advocate Advocate
1,311 Views
8 Replies
Message 1 of 9

CheckInterference Method (ActiveX) for Surfaces?

surfer96
Advocate
Advocate

According to the ActiveX reference the CheckInterference Method only works for 3DSolids:

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-ActiveX/files...

 

Will it also work for surface objects?

 

In AutoCAD it's the same, officially it only works for 3DSolids:

https://help.autodesk.com/view/ACD/2019/ENU/?guid=GUID-FF1ED01E-9AB5-455F-8E84-2F01C2EA3B62

 

But in reality surfaces all also accepted. Draw a box, explode it to regions, change the regions to surfaces and finally interfere the surfaces with themselves. The result will be the box's edges as lines.

Is the same possible in ActiveX?

0 Likes
Accepted solutions (1)
1,312 Views
8 Replies
Replies (8)
Message 2 of 9

doaiena
Collaborator
Collaborator
Accepted solution

When trying to find out, whether a method is applicable to a certain object, go check the object type's methods and see if it is applicable, rather than looking at the documentation for the method itself.

 

Yes, surfaces have an IntersectWith method.

http://help.autodesk.com/view/OARX/2019/DEU/?guid=GUID-98BC3DD3-F913-494C-8559-EAFA0DDEFE3E

Message 3 of 9

surfer96
Advocate
Advocate

However IntersectWith and CheckInterference might not be exactly the same. IntersectWith for two surfaces should return points, whereas CheckInterference would return a line. In case the CheckInterference method applies to surfaces...

0 Likes
Message 4 of 9

doaiena
Collaborator
Collaborator

Excuse my mistake. I somehow managed to mix up interfere with intersect. I am surprised that surfaces don't have a CheckInterference method, having in mind that AutoCAD's interfere command is compatible with those object types.

 

There is still a workaround to automate this through lisp and the use of the "interfere" command in AutoCAD. Are you interested in the interference object created by to interfering surfaces, or you just want to know if two or more surfaces interfere?

0 Likes
Message 5 of 9

surfer96
Advocate
Advocate

I want to get the interference objects, i.e. lines resulting from surface interference like in the image below.

The green surfaces interfere with the blue box thus producing a grid of lines. Coplanar lines lying on the same surface of the initial box, will then be changed to regions with their areas calculated. I think this should all work with AutoLISP or ActiveX code without AutoCAD interaction in between.Unbenannt.JPG

 

0 Likes
Message 6 of 9

SEANT61
Advisor
Advisor

Are the green surface always planar?  If so, another possible method may be to use Acad3DSolid.SliceSolid on a copy of the original solid.  All those Slice remnants could then be exploded down to the desired Regions.  


************************************************************
May your cursor always snap to the location intended.
Message 7 of 9

surfer96
Advocate
Advocate

Yes, the surfaces are planar, so slicing would work.

Sounds like AutoCAD's  original "_slice" command with keeping both sides...

0 Likes
Message 8 of 9

doaiena
Collaborator
Collaborator

At the moment i don't have time to prepare a proper demo to illustrate my point, but this quick and dirty example will get you going.

 

(defun c:Test ( / ss ) 

(if (setq ss (ssget '((0 . "3DSOLID,SURFACE,PLANESURFACE"))))
(progn
(command "-interfere" ss "" "")
(if (> (getvar 'cmdactive) 0) (command "y"))
(if (> (getvar 'cmdactive) 0) (command "n"))
(if (> (getvar 'cmdactive) 0) (command "x"))
))
(princ)
) 

 

Message 9 of 9

surfer96
Advocate
Advocate

Works for both solids and surfaces...

0 Likes