firavolla Posted July 12, 2010 Posted July 12, 2010 Ok guys. I'm back, big as life and twice as ugly . Here's my problem. I have a function in vba that I use to draw some dimensions between points. The type of dim is Aligned and the problem is, after I create the dim, I don't know how to set it's layer. I want all my dims to be in a layer let's say 'layerX'. Public Sub drawDimSupra(pIn1 As Variant, pIn2 As Variant) Dim tip As Integer Dim cota As AcadDimAligned Dim pText As Variant Dim pStart As Variant Dim pEnd As Variant pStart = pIn1 pEnd = pIn2 pText = pStart pText(0) = (pStart(0) + pEnd(0)) / 2 pText(1) = (pStart(1) + pEnd(1) + 70) / 2 Set cota = ThisDrawing.ModelSpace.AddDimAligned(pStart, pEnd, pText) cota.Layer = "layerX" End Sub And it does not work. Any help ? Quote
firavolla Posted July 12, 2010 Author Posted July 12, 2010 ) Weird stuff. Friday the same subroutine gave me an error. Now it works. Quote
SEANT Posted July 12, 2010 Posted July 12, 2010 The routine will error if the layer “layerX” does not already exist in the current drawing. 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.