-KarL- Posted December 29, 2008 Share Posted December 29, 2008 I am looking for a way to modify a dim style. Mainly the color of the text and dim lines. I have tried searching the forum but have not been able to find anything that works yet. Thanks for any help -KarL- Quote Link to comment Share on other sites More sharing options...
Raggi_Thor Posted December 29, 2008 Share Posted December 29, 2008 Sorry, pasted something from the help file, but now I see the problem. I don't find the proerties you need in the dimstyle object. Maybe you have to do it with SendCommand or simmilar, as in a script. Quote Link to comment Share on other sites More sharing options...
CmdrDuh Posted December 30, 2008 Share Posted December 30, 2008 I have just what you need, brb Quote Link to comment Share on other sites More sharing options...
CmdrDuh Posted December 30, 2008 Share Posted December 30, 2008 Option Explicit Public Sub DWGSetup() Dim objstyle As AcadTextStyle Dim objLayer As AcadLayer Dim objlinetype As AcadLineType Dim objDimStyle As AcadDimStyle Dim SysvarName As String Dim dblVardata As Double Dim strVarData As String Dim sysVarData As Variant Dim DataType As Integer Dim intData As Integer ThisDrawing.SetVariable "expert", 5 ThisDrawing.ActiveLayer = ThisDrawing.Layers("0") Set objDimStyle = ThisDrawing.DimStyles.Add("TEP") objDimStyle.CopyFrom ThisDrawing ThisDrawing.ActiveDimStyle = objDimStyle SysvarName = "PLINEGEN" intData = 1 ThisDrawing.SetVariable SysvarName, intData SysvarName = "DIMALTF" dblVardata = 25.4 ThisDrawing.SetVariable SysvarName, dblVardata SysvarName = "DIMAPOST" strVarData = "" ThisDrawing.SetVariable SysvarName, strVarData objDimStyle.CopyFrom ThisDrawing ThisDrawing.Regen acAllViewports End Sub Quote Link to comment Share on other sites More sharing options...
-KarL- Posted December 30, 2008 Author Share Posted December 30, 2008 Perfect!! Thanks again CmdrDuh Quote Link to comment Share on other sites More sharing options...
brengine Posted July 10, 2009 Share Posted July 10, 2009 Thanks for the code. Works fine for me except one thing...the changes aren't seen on-screen until I manually go into the DimStyle Dialog, Select the Style I changed and click Modify, then I have to click OK. I have to repeat that process for each DimStyle I modified. The only variation I did from the code above is that I used an assigned objDrawing variable instead of ThisDrawing. Thanks for any direction you can provide... Quote Link to comment Share on other sites More sharing options...
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.