VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

divide a region into several regions

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
5748 Views, 10 Replies

divide a region into several regions

hi,

as i know there is not a method to divide a region into several regions,

there is a SliceSolid to solids,but not to region objects,

any hints ,thanks a lot
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

maybe ,i have to made a solid using the region ,then slice it

into several solids,then explode the solids to region ,ect,......

boring sub, better avoid this,



"youngman" wrote in message
news:5449405@discussion.autodesk.com...
hi,

as i know there is not a method to divide a region into several regions,

there is a SliceSolid to solids,but not to region objects,

any hints ,thanks a lot
Message 3 of 11
SEANT
in reply to: Anonymous

It's even worse than that. Unless it is a recent addition, there isn't an "Explode" method for 3dSolids. A "SectionSolid" call is required, with the appropriate set of points describing a plane.

I was able to pull the various elements together to achieve a slice region routine but, as you guessed, it was long and tedious.
Message 4 of 11
Anonymous
in reply to: Anonymous

THANKS A LOT.

would you please give me the long and tedious subs and funs

thank you in advance

wrote in message news:5449555@discussion.autodesk.com...
It's even worse than that. Unless it is a recent addition, there isn't an
"Explode" method for 3dSolids. A "SectionSolid" call is required, with the
appropriate set of points describing a plane.

I was able to pull the various elements together to achieve a slice region
routine but, as you guessed, it was long and tedious.
Message 5 of 11
SEANT
in reply to: Anonymous

I had to collect subs from various modules so bare with me if something is amiss. I'll be away for the rest of the day but will address any problems when I return.

As additional background, this procedure mimicks the 2PTSlice of 2007 for earlier versions. It will slice many of Autocad's 2d elements as well i.e., Region, Circle, LWPolyline, etc.

The 2d elements don't neccessarily need to be coplanar to the UCS.

I welcome all feedback
Message 6 of 11
Anonymous
in reply to: Anonymous

Thanks a lot.
i havent tried your subs, but, first of all,

thanks for your kindness,SEANT




wrote in message news:5449563@discussion.autodesk.com...
I had to collect subs from various modules so bare with me if something is
amiss. I'll be away for the rest of the day but will address any problems
when I return.

As additional background, this procedure mimicks the 2PTSlice of 2007 for
earlier versions. It will slice many of Autocad's 2d elements as well i.e.,
Region, Circle, LWPolyline, etc.

The 2d elements don't neccessarily need to be coplanar to the UCS.

I welcome all feedback
Message 7 of 11
QuillHyde
in reply to: SEANT

When I try and implement this, it works great, once.  Then when I run the macro again, Autocad crashes.

 

Any tips?

 

thanks!

 

Quill

Message 8 of 11
QuillHyde
in reply to: QuillHyde

Selection sets! 

 

I copied some code from one of your other examples - the hiding/unhiding code - where you had used a different method for clearing the selection set.  Or something.  I'm a noob at this, but it worked.


Then it got hung up on the delete the original regions code, so I messed around with that.  It gave a code 13 error on the 'if IsObject (varRegs(0)) Then' line - I got it to work by commenting out all the 'if' stuff and just having it run ent2bsliced.delete - it works so far. 

 

good times, learning the hard way.  Thanks for posting the code,  It's a really useful tool for me ... it's going to save me hours and hours of tedious exploding and deleting, and I'll thank you every time.

 

Quill

Message 9 of 11
QuillHyde
in reply to: QuillHyde

Well, sort of works.  Good enough for now.  Hopefully I'll figure it out eventually

 

Quill

Message 10 of 11
SEANT61
in reply to: QuillHyde

That is performing poorly in AutoCAD 2009.  It was orignally written for AutoCAD 2004 - Selection Sets may have been handled differently back then.

 

How does the rest of the module work if this routine is replaced:

 

 

Private Sub SSClearST()
Dim colSS As AcadSelectionSet

   'ensure that selection set does not currently exist
   On Error Resume Next
   Set colSS = ThisDrawing.SelectionSets.Item("TempSSet")
   colSS.Delete
   On Error GoTo 0

End Sub

 


************************************************************
May your cursor always snap to the location intended.
Message 11 of 11
QuillHyde
in reply to: SEANT61

Yep, that fixed it.

 

thanks x 10,000,000!

 

Quill

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost