Slicing a solid within the transaction manager

Slicing a solid within the transaction manager

Anonymous
Not applicable
439 Views
1 Reply
Message 1 of 2

Slicing a solid within the transaction manager

Anonymous
Not applicable
Hello,

I seem to be stuck on this one and yes I am just a learner. I am writing a sample code which opens Autocad and then I netload the DLL. I then open a file with a 3D solid already on it. I have previously saved this 3D solid as a block.

The sample code from the AutoCAD developers guide does the same thing with a cube and then slices it. To make this work a variable is assigned conveniently to the cube during its creation.

Since I did not create the 3D solid in this code session, how can I assign a variable to the 3D solid? You can iterate through block table records and such but how is the code written to say this block table record is there now assign a variable to it and then slice it?

Dim acSol3D As Solid3d = New Solid3d

Using acTrans As Transaction = ADData.TransactionManager.StartTransaction()
Dim SelObjectbt As BlockTable

SelObjectbt = acTrans.GetObject(ADData.BlockTableId, OpenMode.ForRead)

Dim SelObject As BlockTableRecord

If SelObjectbt.Has("Obj") Then

End If

acSol3D = ?
SelObject = acTrans.GetObject(SelObjectbt(BlockTableRecord.ModelSpace), OpenMode.ForWrite)

The rest of the code comes right from the developers guide.

THX in advance,
not.testee Edited by: not.testee on Feb 24, 2010 7:59 PM
0 Likes
440 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
You have to find the object you want to slice. You can do
that in one of several ways. First is by using a SelectionFilter
and the Editor's SelectAll() method, to find objects matching
a given search critera. The second way is to iterate over all
objects in the model space block, and look at each until you
find the one you want to slice.

So, you have to research using SelectionFilters and the
SelectAll() method of the Editor class.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:[email protected]...
Hello,

I seem to be stuck on this one and yes I am just a learner. I am writing a
sample code which opens Autocad and then I netload the DLL. I then open a file
with a 3D solid already on it. I have previously saved this 3D solid as a block.

The sample code from the AutoCAD developers guide does the same thing with a
cube and then slices it. To make this work a variable is assigned conveniently
to the cube during its creation.

Since I did not create the 3D solid in this code session, how can I assign a
variable to the 3D solid? You can iterate through block table records and such
but how is the code written to say this block table record is there now assign a
variable to it and then slice it?

Dim acSol3D As Solid3d = New Solid3d

Using acTrans As Transaction = ADData.TransactionManager.StartTransaction()
Dim SelObjectbt As BlockTable

SelObjectbt = acTrans.GetObject(ADData.BlockTableId,
OpenMode.ForRead)

Dim SelObject As BlockTableRecord

If SelObjectbt.Has("Obj") Then

End If

acSol3D = ?
SelObject =
acTrans.GetObject(SelObjectbt(BlockTableRecord.ModelSpace), OpenMode.ForWrite)

The rest of the code comes right from the developers guide.

THX in advance,
not.testee

Edited by: not.testee on Feb 24, 2010 7:59 PM
0 Likes