Hi,
I'm doing my first big VBA programming and having very meny questions. I want to get values of current Layer, Text style, Linetype, Lineweight and Color then set what I want and then set back these 5 values to what they were at the beginning.
With Layer, Textstyle and Linetype I can get through like this:
but I can't do same with lineweight and color properties. What are other ways how to do this?Code:Set BeginningLayer = ThisDrawing.ActiveLayer Set BeginningTextStyle = ThisDrawing.ActiveTextStyle Set BeginningLinetype = ThisDrawing.ActiveLinetype
Also, additional question about making blocks. In block definition I place some polylines and Mtexts. I want to have their properties BYBLOCK but this far I succeed only with Linewight and it looks like this:
How do I set Color and Linetype properties BYBLOCK?Code:pl.Lineweight = acLnWtByBlock mTextObj.Lineweight = acLnWtByBlock
OK, I got it myself about block:
in the begining of block definition I place:
ThisDrawing.ActiveLinetype = ThisDrawing.Linetypes.Item("BYBLOCK")
this makes every object's linetype BYBLOCK
And with color for each object I use:
pl.color = acByBlock
For some reason VB doesn't offer "color" in the drop-down list after typing "pl." but it offers a drop-down list after typing "=".
So, I'm done BYBLOCK question and the only unclear is about active lineweight and color properties. Anyway, any thaughts about how it could be done better are welcome!