Witam
i już po problemie :) :grin:
tworząc nowy styl wymiarowania pobiera on ustawienia ze zmiennych systemowych, więc najpierw nadaje odpowiednim zmiennym odpowiednie wartości a potem dodaje styl.
Przykładowy kod poniżej:
Sub Nowy_StylWYM()
Dim newStyle1 As ZwcadDimStyle
Thisdocument.SetVariable "DIMSCALE", 1
Thisdocument.SetVariable "DIMBLK", "."
Thisdocument.SetVariable "DIMASZ", 2.5
Thisdocument.SetVariable "DIMTXSTY", "Standard" '
Thisdocument.SetVariable "DIMTXT", 3
Thisdocument.SetVariable "DIMCLRT", 4
Thisdocument.SetVariable "DIMTAD", 0
Thisdocument.SetVariable "DIMTVP", 2.5 / 3
Thisdocument.SetVariable "DIMCLRE", 8
Thisdocument.SetVariable "DIMDLE", 0 '1.25
Thisdocument.SetVariable "DIMCLRD", 8
Thisdocument.SetVariable "DIMEXE", 2
Thisdocument.SetVariable "DIMJUST", 0
Thisdocument.SetVariable "DIMEXO", 10
Thisdocument.SetVariable "DIMRND", 1
Thisdocument.SetVariable "DIMDEC", 0
Thisdocument.SetVariable "DIMADEC", 1
Thisdocument.SetVariable "DIMTMOVE", 0
Thisdocument.SetVariable "DIMDLI", 5
Thisdocument.SetVariable "DIMATFIT", 0
Set newStyle1 = Thisdocument.DimensionStyles.Add("STYL_1")
Thisdocument.ActiveDimStyle = newStyle1
End Sub
W przeciwieństwie do tworzenia stylów tekstów to powyższy kod działa tylko przy pierwszym użyciu, przy drugiej próbie wyskakuje gdyż już taki styl ma dodany. Moje pytanie w związku z tym, czy ktoś wie jak sprawdzić czy dany styl już istnieje
- jeżeli niema to dodaje a jeżeli istnieje to nie dodaje. Proszę o jakiś przykład.
Z góry dziękuje