.NET

Reply
Active Member
jvelasco
Posts: 7
Registered: ‎10-23-2005
Message 1 of 2 (119 Views)

Create Material

119 Views, 1 Replies
05-15-2006 03:17 AM
I try to create Material in AutoCAD 2007 by this way:

Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
Dim tm As DBTransMan = db.TransactionManager
Dim myT As Transaction
' myT = tm.StartTransaction()
Dim tt As Autodesk.AutoCAD.DatabaseServices.Material = New Autodesk.AutoCAD.DatabaseServices.Material


tt.Name = "Mat_new"
tt.Description = "New Material"
myT.AddNewlyCreatedDBObject(tt, True)
myT.Commit()

'but it does not work. Some idea?

Thanks & regards

jvelasco

'www.yudigar.com
*Bobby C. Jones
Message 2 of 2 (119 Views)

Re: Create Material

05-16-2006 10:44 AM in reply to: jvelasco
Just a guess, but you probably have to add it to the Database in order to
use it.
--
Bobby C. Jones

wrote in message news:5174355@discussion.autodesk.com...
I try to create Material in AutoCAD 2007 by this way:

Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database
Dim tm As DBTransMan = db.TransactionManager
Dim myT As Transaction
' myT = tm.StartTransaction()
Dim tt As Autodesk.AutoCAD.DatabaseServices.Material = New
Autodesk.AutoCAD.DatabaseServices.Material


tt.Name = "Mat_new"
tt.Description = "New Material"
myT.AddNewlyCreatedDBObject(tt, True)
myT.Commit()

'but it does not work. Some idea?

Thanks & regards

jvelasco

'www.yudigar.com

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community