- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to write code subtract 2 region items
i found 1 way using Autocad by
command Region and select 2 closed polyline
Then
command IN (intersect) select 2 region objects ("RegionRoom") & ("RegionTile")
I search further and found that Boolean Method (ActiveX) may do the job
object.Boolean(Operation, Object)
AutoCAD 2022 Developer and ObjectARX Help | Boolean Method (ActiveX) | Autodesk
I created two Region object by using code to convert two closed polylines
the issue is that i am getting mistake when trying to intersect between two
any recommendations how to solve it
--Moderator edit: Put code into code window.
Dim MyApp As Object
Dim MyDWG As AcadDocument
Set MyApp = GetObject(, "Autocad.Application")
MyApp.Visible = True
Set MyDWG = MyApp.ActiveDocument
'GetEnt
Dim Tile As AcadLWPolyline
Dim Room As AcadLWPolyline
MyDWG.Utility.GetEntity Tile , pp, "Select a polyline: "
MyDWG.Utility.GetEntity Room, pp, "Select a polyline: "
Dim RegionRoom As Variant
Dim RegionTile As Variant
' set Region to match poly object
RegionRoom = MyDWG.ModelSpace.AddRegion(Room)
RegionTile = MyDWG.ModelSpace.AddRegion(Tile )
' in this part i am getting error result
Dim result As AcadRegion
Set result = RegionRoom(acSubtraction, RegionTile)
Solved! Go to Solution.