.NET

Reply
Valued Mentor
KerryBrown
Posts: 276
Registered: ‎11-29-2008
Message 11 of 13 (225 Views)

Re: Change Color, Line Type and Line weight without selecting any objects

03-10-2012 12:07 AM in reply to: Alfred.NESWADBA

 

Alfred,

db.Celtype is an ObjectId

 

 

But this works for me too.

 

	
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;
using AcadColor = Autodesk.AutoCAD.Colors;


            Document doc = AcadApp.DocumentManager.MdiActiveDocument;
            Database db  = doc.Database;

            db.Celweight = LineWeight.LineWeight015;
            db.Cecolor   = AcadColor.Color.FromColorIndex(ColorMethod.ByAci, 1);
            db.Celtype   = db.ContinuousLinetype;
            
            AcadApp.ShowAlertDialog("NOW WE'LL CHANGE THEM BACK.");

            db.Celweight = LineWeight.ByLayer;
            db.Cecolor   =  AcadColor.Color.FromColorIndex(ColorMethod.ByAci,256);
            db.Celtype   = db.ByLayerLinetype;
			
	

 

 

 Regards,

 

 

//-------------------------------------------------------

Everything will work just as you expect it to, unless your expectations are incorrect.

class keyThumper<T> : Lazy<T>;      another  Swamper

Valued Contributor
chockalingam
Posts: 84
Registered: ‎03-06-2012
Message 12 of 13 (218 Views)

Re: Change Color, Line Type and Line weight without selecting any objects

03-10-2012 12:33 AM in reply to: chockalingam

Yes now i got the solution, This works for me.......

*Expert Elite*
Alfred.NESWADBA
Posts: 9,413
Registered: ‎06-29-2007
Message 13 of 13 (205 Views)

Re: Change Color, Line Type and Line weight without selecting any objects

03-10-2012 01:04 AM in reply to: KerryBrown

Hi,

 

>> Alfred, db.Celtype is an ObjectId

Ooops .... thank you (looked at the wrong place).

 

Nice weekend, - alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!