.NET

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

Create Material

122 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 (122 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.