crashingduke Posted November 27, 2009 Posted November 27, 2009 Hello all, When running a macro, I would like to "read" the current value of the color & lwt settings, so I can change them back after the macro is finished. For the linetype, textstyle & current layer I used the following, but that doesn't work for the color & lwt. Does anyone has an idea? Thanks in advange, Robin L = ThisDrawing.ActiveLayer.Name LT = ThisDrawing.ActiveLinetype.Name S = ThisDrawing.ActiveTextStyle.Name ThisDrawing.ActiveLayer = ThisDrawing.Layers.Item("Tekst_zwart") ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.Item("Iso") ThisDrawing.ActiveLinetype = ThisDrawing.Linetypes.Item("Bylayer") ThisDrawing.ActiveLayer = ThisDrawing.Layers.Item(L) ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.Item(S) ThisDrawing.ActiveLinetype = ThisDrawing.Linetypes.Item(LT) Quote
fixo Posted November 27, 2009 Posted November 27, 2009 Hello all, When running a macro, I would like to "read" the current value of the color & lwt settings, so I can change them back after the macro is finished. For the linetype, textstyle & current layer I used the following, but that doesn't work for the color & lwt. Does anyone has an idea? Thanks in advange, Robin L = ThisDrawing.ActiveLayer.Name LT = ThisDrawing.ActiveLinetype.Name S = ThisDrawing.ActiveTextStyle.Name ThisDrawing.ActiveLayer = ThisDrawing.Layers.Item("Tekst_zwart") ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.Item("Iso") ThisDrawing.ActiveLinetype = ThisDrawing.Linetypes.Item("Bylayer") ThisDrawing.ActiveLayer = ThisDrawing.Layers.Item(L) ThisDrawing.ActiveTextStyle = ThisDrawing.TextStyles.Item(S) ThisDrawing.ActiveLinetype = ThisDrawing.Linetypes.Item(LT) Take a look at system variables "CECOLOR" and "CELWEIGHT" You can store variable at the start of code something like this dim ccl dim cwt ccl = Thisdrawing.Getsystemvariable ("CECOLOR") cwt = ThisDrawing.GetSystemVariable ("CELWEIGHT") and and the end restore all: Thisdrawing.Setsystemvariable("CECOLOR", ccl) etc etc HTH ~'J'~ Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.