.NET

Reply
Distinguished Contributor
sgsawdy
Posts: 411
Registered: ‎09-19-2005
Message 1 of 7 (1,203 Views)

Change entity color & linetype problem.

1203 Views, 6 Replies
12-23-2008 11:45 AM
I am using ACADE 2008 and VB.NET. I have a multitude of drawings that I am doing the same three and four operations on and would like to write VB.NET program to do it. I can get my selections set just fine, but my first problem is figuring out how to change all drawing entities color and linetype to "ByLayer". So far I have not gotten past changing just the color value. I have tried multiple variations on the following line without success:

myAcadEnt.Color = Colors.Color.FromDictionaryName("ByLayer")

Can anybody get me pointed in the right direction? I am grateful for any help.

Scott
Distinguished Contributor
NathTay
Posts: 1,691
Registered: ‎12-15-2003
Message 2 of 7 (1,201 Views)

Re: Change entity color & linetype problem.

12-23-2008 01:13 PM in reply to: sgsawdy


myAcadEnt.ColorIndex = 256

Distinguished Contributor
Dale.Bartlett
Posts: 151
Registered: ‎01-06-2003
Message 3 of 7 (903 Views)

Re: Change entity color & linetype problem.

10-16-2012 10:45 PM in reply to: sgsawdy

Is there a similar value for the LinetypeId as for layers to reset to BYLAYER?

ent.ColorIndex = 256; /BYLAYER

// ent.LinetypeId = ???; //BYLAYER

rather than doing this:

ent.Linetype = "BYLAYER";

Dale

ADN Support Specialist
Balaji_Ram
Posts: 737
Registered: ‎03-21-2011
Message 4 of 7 (858 Views)

Re: Change entity color & linetype problem.

10-23-2012 09:30 AM in reply to: Dale.Bartlett

Hello Dale,

 

"Database.ByLayerLineType" property will give you the ObjectId of the "ByLayer" line type.



Balaji
Developer Technical Services
Autodesk Developer Network

Distinguished Contributor
Dale.Bartlett
Posts: 151
Registered: ‎01-06-2003
Message 5 of 7 (833 Views)

Re: Change entity color & linetype problem.

10-24-2012 08:34 PM in reply to: sgsawdy

That's correct. But what I want to know is what is the LinetypeID eqivalent of "BYLAYER"?. Thanks for hte reply, Dale

Valued Mentor
fieldguy
Posts: 379
Registered: ‎03-31-2005
Message 6 of 7 (815 Views)

Re: Change entity color & linetype problem.

10-25-2012 08:05 AM in reply to: Dale.Bartlett

Something like this -

ent.linetype = db.ByLayerLinetype

 

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 7 of 7 (786 Views)

Re: Change entity color & linetype problem.

10-26-2012 02:26 AM in reply to: Dale.Bartlett

dbartlett wrote:

That's correct. But what I want to know is what is the LinetypeID eqivalent of "BYLAYER"?. Thanks for hte reply, Dale


 

Balaji told you - it is returned by the property he mentioned, and it must be assigned to the entity's LinetypeId property (as opposed to the Linetype property)

 

 

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!