Link to home
Start Free TrialLog in
Avatar of marco_greven
marco_greven

asked on

.net Autodesk.Aec.Modeler.Body

Hello,

I am new to .Net programming in AutoCAD Architecture and going thru the samples from Autodesk.
In a sample they create a cone thru VB.NET.

I managed to alter the code to draw a 3D box with the following code:
    Private Function CreateMassBox(ByVal InsPnt As Point3d, ByVal Afmeting3D As Vector3d) As ObjectId
        ' Functie om een 3D box te tekenen...
        Dim db As Database = HostApplicationServices.WorkingDatabase
        Dim tm As Autodesk.AutoCAD.DatabaseServices.TransactionManager = db.TransactionManager
        Dim id As ObjectId
        Dim t As Transaction = tm.StartTransaction()
        Try
            Dim bt As BlockTable = tm.GetObject(db.BlockTableId, OpenMode.ForRead, False)
            Dim btr As BlockTableRecord = tm.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite, False)
            Dim temp As Autodesk.Aec.DatabaseServices.MassElement = Autodesk.Aec.DatabaseServices.MassElement.Create(ShapeType.BoundaryRepresentation)
            Dim body As Autodesk.Aec.Modeler.Body = Autodesk.Aec.Modeler.Body.Box(InsPnt, Afmeting3D)
            temp.SetDatabaseDefaults()
            temp.SetBody(body, False)
            id = btr.AppendEntity(temp)
            tm.AddNewlyCreatedDBObject(temp, True)
            t.Commit()
        Finally
            t.Dispose()
        End Try
        Return id
    End Function

I also tried to create a 3D body of the "RightTriangle" type, but i can't figure out how to do this and i can't find any documentation or samples about this.
Can anyone help me with a sample?

Kind regards,

Marco
Avatar of darrenmcwi
darrenmcwi
Flag of United States of America image

You'll find a larger pool of Autodesk .Net programmers here that should be able to answer your question...

http://www.theswamp.org/
ASKER CERTIFIED SOLUTION
Avatar of marco_greven
marco_greven

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial