Message 1 of 2
Slicing a solid within the transaction manager
Not applicable
02-24-2010
11:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
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