Macro / VBA - Drawing file setup

Discussion in 'SolidWorks' started by BWelch, Aug 2, 2005.

  1. BWelch

    BWelch Guest

    Hi all


    Any VBA guru's out there?

    I would like to be able to programatically set specific properties in a
    drawing document using VBA.
    Specific Document Properties such as Text size and font of Dimensions,
    Notes, Arrow size, leader length, etc.

    I've been scouring over the Solidworks Object Model, for weeks (in my spare
    time), but not been able to find a reference to the document property
    pages.

    for instance - From the menu:
    Tools - Options - Document Properties
    - Units
    - Dimensions - bent leader length
    - Arrows - size
    - Annotations Font - Note
    - Annotations Font - Dimension
    - Annotations Font - Tables

    The idea is to open a series of existing drawings to update and revise
    arrow size and font etc. of notes baloons and dimensions all by automation.
    Thus to bring a batch of old drawings to a common standard.

    I have been succesfull at removing then recreating custom properties and
    repopulating them with prefferred information. Also have been able to
    replace the drawing sheet with a revised one containing revisions to the
    title block.

    Accessing the docment properties has me stumped and thinking that they are
    not exposed to automation.

    Any help is greatly appreciated.

    BW
     
    BWelch, Aug 2, 2005
    #1
  2. I'm no expert, but you might start here and see if it's what you are looking
    for. Look up swUserPreferenceDoubleValue_e in the API help.

    WT
     
    Wayne Tiffany, Aug 2, 2005
    #2
  3. BWelch

    BWelch Guest

    Wow!

    Yes that's the stuff.

    Upon a quick review of the help files, it looks like exactly what I've
    been looking for.

    Can't wait to get some code into action.



    Thanks a bunch.

    BW
     
    BWelch, Aug 2, 2005
    #3
  4. BWelch

    rmchugh Guest

    Here's one I did to standardize every setting I could find at the time.
    You can run it on any existing part/assy/dwg and it will update
    everything to these settings. I've used it on SWX 2003 and tried it on
    SWX 2004; but I don't use SWX anymore so I'm not sure if it will work on
    SWX 2005. Thankfully, my new job is using Solidworks but I won't get to
    try the macro until next week.

    Ray

    Sub main()

    Set swApp = CreateObject("SldWorks.Application")
    Set Part = swApp.ActiveDoc
    ''''FontName = "Arial"
    FontName = "Century Gothic"
    ''''FontName = "Lucida Sans Unicode"
    ''''FontName = "Verdana"
    ''''FontName = "Microsoft Sans Serif"
    Let doctype = Part.GetType

    '''''Notes & Annotations
    Set FormatObj = Part.GetUserPreferenceTextFormat(swDetailingNoteTextFormat)
    FormatObj.TypeFaceName = FontName
    FormatObj.CharHeightInPts = 13
    FormatObj.Bold = False
    FormatObj.Italic = False
    FormatObj.Underline = False
    FormatObj.Strikeout = False
    ok = Part.SetUserPreferenceTextFormat(0, FormatObj)

    '''''dimensions
    Set FormatObj =
    Part.GetUserPreferenceTextFormat(swDetailingDimensionTextFormat)
    FormatObj.TypeFaceName = FontName
    FormatObj.CharHeightInPts = 13
    FormatObj.Bold = False
    FormatObj.Italic = False
    FormatObj.Underline = False
    FormatObj.Strikeout = False
    ok = Part.SetUserPreferenceTextFormat(1, FormatObj)

    '''''section
    Set FormatObj =
    Part.GetUserPreferenceTextFormat(swDetailingSectionTextFormat)
    FormatObj.TypeFaceName = FontName
    FormatObj.CharHeightInPts = 24
    FormatObj.Bold = False
    FormatObj.Italic = True
    FormatObj.Underline = True
    FormatObj.Strikeout = False
    ok = Part.SetUserPreferenceTextFormat(2, FormatObj)

    '''''details
    Set FormatObj =
    Part.GetUserPreferenceTextFormat(swDetailingDetailTextFormat)
    ''''FormatObj.TypeFaceName = "Microsoft Sans Serif"
    FormatObj.TypeFaceName = FontName
    ''''FormatObj.CharHeightInPts = 16
    FormatObj.CharHeightInPts = 24
    FormatObj.Bold = False
    FormatObj.Italic = True
    FormatObj.Underline = False
    FormatObj.Strikeout = False
    ok = Part.SetUserPreferenceTextFormat(3, FormatObj)

    '''''View Arrow
    Set FormatObj =
    Part.GetUserPreferenceTextFormat(swDetailingViewArrowTextFormat)
    FormatObj.TypeFaceName = FontName
    ''''FormatObj.TypeFaceName = "Century Gothic"
    ''''FormatObj.CharHeightInPts = 16
    FormatObj.CharHeightInPts = 24
    FormatObj.Bold = False
    FormatObj.Italic = True
    FormatObj.Underline = True
    FormatObj.Strikeout = False
    ok = Part.SetUserPreferenceTextFormat(4, FormatObj)

    '''''surface finish
    Set FormatObj =
    Part.GetUserPreferenceTextFormat(swDetailingSurfaceFinishTextFormat)
    FormatObj.TypeFaceName = FontName
    FormatObj.CharHeightInPts = 13
    FormatObj.Bold = False
    FormatObj.Italic = False
    FormatObj.Underline = False
    FormatObj.Strikeout = False
    ok = Part.SetUserPreferenceTextFormat(5, FormatObj)

    '''''weld symbols
    Set FormatObj =
    Part.GetUserPreferenceTextFormat(swDetailingWeldSymbolTextFormat)
    FormatObj.TypeFaceName = FontName
    FormatObj.CharHeightInPts = 13
    FormatObj.Bold = False
    FormatObj.Italic = False
    FormatObj.Underline = False
    FormatObj.Strikeout = False
    ok = Part.SetUserPreferenceTextFormat(6, FormatObj)

    'swDetailingDimensionStandard = 13
    'ANSI = 1, ISO = 2, DIN = 3, JIS = 4, BS = 5, GOST = 6
    retval = Part.SetUserPreferenceIntegerValue(13, 1)

    'swDetailingDualDimensions = 43 on=1, off=0
    retval = Part.SetUserPreferenceToggle(43, 0)

    'swDetailingDualDimPosition = 14
    'SideBySide = 1, AboveAndBelow = 2
    retval = Part.SetUserPreferenceIntegerValue(14, 1)

    'swDetailingFixedSizeWeldSymbol = 47
    'fixed=1, varies=0
    retval = Part.SetUserPreferenceToggle(47, 1)

    'swDetailingDisplayDatumsPer1982 = 44
    '1982std=1, other=0
    retval = Part.SetUserPreferenceToggle(44, 0)

    'swDetailingDimTrailingZero = 15
    'Smart = 0, Show = 1, Remove = 2
    retval = Part.SetUserPreferenceIntegerValue(15, 0)

    'swDetailingDisplayAlternateSection = 45
    'alternate=1, standard=0
    retval = Part.SetUserPreferenceToggle(45, 0)

    'swDetailingCenterlineExtension=10
    'extension distance in meters (.003175m=.125")
    retval = Part.SetUserPreferencedoubleValue(10, ".003175")

    'swDetailingCenterMarkShowLines = 46
    'show=1 off=0
    retval = Part.SetUserPreferenceToggle(46, 0)

    'swDetailingCenterMarkSize=12
    'extension distance in meters (.003175m=.125")
    retval = Part.SetUserPreferencedoubleValue(12, ".003175")

    'swDetailingBreakLineGap = 11
    'distance in meters (.0127m=.5")
    retval = Part.SetUserPreferencedoubleValue(11, ".0127")

    'swDetailingWitnessLineExtension=14
    'extension distance in meters (.00127m=.05")
    retval = Part.SetUserPreferencedoubleValue(14, ".00127")

    'swDetailingWitnessLinegap=13
    'extension distance in meters (.00127m=.05")
    retval = Part.SetUserPreferencedoubleValue(13, ".00127")

    'swDetailingDimsShowParenthesisByDefault = 48
    '() on=1, () off=0
    retval = Part.SetUserPreferenceToggle(48, 0)

    'swDetailingDimsSnapTextToGrid = 49
    'snap on=1, snap off=0
    retval = Part.SetUserPreferenceToggle(49, 0)

    'swDetailingDimsCenterText = 50 text
    'centered=1, not centered=0
    retval = Part.SetUserPreferenceToggle(50, 0)

    'swDetailingObjectToDimOffset = 15, (.009652m=.38")
    retval = Part.SetUserPreferencedoubleValue(15, ".009652")

    'swDetailingDimToDimOffset = 16, (.00635m=.25")
    retval = Part.SetUserPreferencedoubleValue(16, ".00635")

    'swDetailingArrowStyleForDimensions = 16,
    'OPEN=0, CLOSED=1, SLASH=2, DOT=3, ORIGIN=4, WIDE=5,
    'ISOWIDE=6, RUS=7, CLOSETOP=8, CLOSEBOT=9, NO=10
    retval = Part.SetUserPreferenceIntegerValue(16, 1)

    'swDetailingDimensionArrowPosition = 17,
    'Inside=0, Outside=1, Smart=2
    retval = Part.SetUserPreferenceIntegerValue(17, 2)

    'swDetailingRadialDimsDisplay2ndOutsideArrow = 51
    'display = 1, don't display = 0
    retval = Part.SetUserPreferenceToggle(51, 0)

    'swDetailingRadialDimsArrowsFollowText = 52
    'follow text = 1, dont follow = 0
    retval = Part.SetUserPreferenceToggle(52, 1)

    'swDetailingDimBentLeaderLength = 39 (.003175m=.125")
    retval = Part.SetUserPreferencedoubleValue(39, ".003175")

    'swDetailingNoteBentLeaderLength = 23 (.00381m=.15")
    retval = Part.SetUserPreferencedoubleValue(23, ".00381")

    'SET DETAILING FONT HERE WHEN YOU FIGURE IT OUT
    'Ya big Sally
    'swDetailingDimFontHeight = 1, .003175m=.125"
    retval = Part.SetUserPreferencedoubleValue(1, ".003175")

    'swDetailingDimLeaderOverrideStandard = 53
    '1=OVERRIDE DOC STANDARD 0=DON'T
    retval = Part.SetUserPreferenceToggle(53, 0)

    'swDetailingLinearDimPrecision = 24, number of dec. places
    retval = Part.SetUserPreferenceIntegerValue(24, 3)

    'swDetailingLinearTolPrecision = 25, number of dec. places
    retval = Part.SetUserPreferenceIntegerValue(25, 3)

    'swDetailingAltLinearDimPrecision = 26, number of dec. places
    retval = Part.SetUserPreferenceIntegerValue(26, 1)

    'swDetailingAltLinearTolPrecision = 27, number of dec. places
    retval = Part.SetUserPreferenceIntegerValue(27, 1)

    'swDetailingAngularDimPrecision = 28, number of dec. places
    retval = Part.SetUserPreferenceIntegerValue(28, 0)

    'swDetailingAngularTolPrecision = 29, number of dec. places
    retval = Part.SetUserPreferenceIntegerValue(29, 0)

    'swDetailingLinearToleranceStyle = 21,
    'NONE=0, BASIC=1, BILAT= 2, LIMIT=3,
    'SYMMETRIC=4, MIN= 5, MAX=6, METRIC=7
    retval = Part.SetUserPreferenceIntegerValue(21, 0)

    'swDetailingMaxLinearToleranceValue = 17 (max value in meters)
    'swDetailingMinLinearToleranceValue = 18 (min value in meters)
    retval = Part.SetUserPreferencedoubleValue(17, "0")
    retval = Part.SetUserPreferencedoubleValue(18, "0")

    'swDetailingAngularToleranceStyle = 22
    'NONE=0, BASIC=1, BILAT= 2, LIMIT=3,
    'SYMMETRIC=4, MIN= 5, MAX=6, METRIC=7
    retval = Part.SetUserPreferenceIntegerValue(22, 0)

    'swDetailingMaxAngularToleranceValue = 19 (max value in radians)
    'swDetailingMinAngularToleranceValue = 20 (min value in radians)
    retval = Part.SetUserPreferencedoubleValue(19, "0")
    retval = Part.SetUserPreferencedoubleValue(20, "0")

    'swDetailingToleranceTextScale = 21
    'swDetailingToleranceTextHeight = 22 (.003175m=.125")
    retval = Part.SetUserPreferencedoubleValue(21, "1")
    retval = Part.SetUserPreferencedoubleValue(22, ".003175")

    'swDetailingToleranceTextSizing = 23,
    'Use Dimension's Font = 0, Scaled = 1, Height = 2
    retval = Part.SetUserPreferenceIntegerValue(23, 0)

    'swDetailingNoteFontHeight = 0 (.003175m=.125")
    retval = Part.SetUserPreferencedoubleValue(0, ".003175")

    'swDetailingNoteTextAlignment = 30
    'Left Justified=1, Center Justified=2, Right Justified=3
    retval = Part.SetUserPreferenceIntegerValue(30, 1)

    'swDetailingNoteLeaderSide = 31
    'Closest=0, Left=1, Right=2
    retval = Part.SetUserPreferenceIntegerValue(31, 0)

    'Const swDetailingNotesDisplayWithBentLeader = 54
    '0=straight, 1=bent
    retval = Part.SetUserPreferenceToggle(54, 1)

    'swDetailingNoteBentLeaderLength = 23 (.003175m=.125")
    retval = Part.SetUserPreferencedoubleValue(23, ".003175")

    'swDetailingBalloonStyle = 32,
    'None = 0, Circular = 1, Triangle = 2, Hexagon = 3
    'Box = 4, Diamond = 5, SplitCirc = 6, Pentagon = 7
    'FlagPentagon = 8, FlagTriangle = 9
    retval = Part.SetUserPreferenceIntegerValue(32, 0)

    'swDetailingBalloonFit = 33
    'Tightest = 0, 1Char = 1, 2Chars = 2,
    '3Chars = 3, 4Chars = 4, 5Chars = 5
    retval = Part.SetUserPreferenceIntegerValue(33, 0)

    'swDetailingBOMBalloonStyle = 34
    'None = 0, Circular = 1, Triangle = 2, Hexagon = 3
    'Box = 4, Diamond = 5, SplitCirc = 6, Pentagon = 7
    'FlagPentagon = 8, FlagTriangle = 9
    retval = Part.SetUserPreferenceIntegerValue(34, 1)

    'swDetailingBOMBalloonFit = 35
    'Tightest = 0, 1Char = 1, 2Chars = 2,
    '3Chars = 3, 4Chars = 4, 5Chars = 5
    retval = Part.SetUserPreferenceIntegerValue(35, 0)

    'swDetailingBOMStackedBalloonStyle = 97
    'None = 0, Circular = 1, Triangle = 2, Hexagon = 3
    'Box = 4, Diamond = 5, SplitCirc = 6, Pentagon = 7
    'FlagPentagon = 8, FlagTriangle = 9
    retval = Part.SetUserPreferenceIntegerValue(97, 1)

    'swDetailingBOMStackedBalloonFit = 98
    'Tightest = 0, 1Char = 1, 2Chars = 2,
    '3Chars = 3, 4Chars = 4, 5Chars = 5
    retval = Part.SetUserPreferenceIntegerValue(98, 0)

    'swDetailingBOMUpperText = 36
    'swDetailingBOMLowerText = 37
    'Custom = 1, ItemNumber = 2, TextQuantity = 3
    retval = Part.SetUserPreferenceIntegerValue(36, 2)
    retval = Part.SetUserPreferenceIntegerValue(37, 3)

    'swDetailingArrowHeight = 24 (.001016m = .04")
    'swDetailingArrowWidth = 25 (.003048m = .12")
    'swDetailingArrowLength = 26 (.00762m = .3")
    retval = Part.SetUserPreferencedoubleValue(24, ".001016")
    retval = Part.SetUserPreferencedoubleValue(25, ".003048")
    retval = Part.SetUserPreferencedoubleValue(26, ".00762")

    'swDetailingSectionArrowHeight = 27 (.002032m = .08")
    'swDetailingSectionArrowWidth = 28 (.006096m = .24")
    'swDetailingSectionArrowLength = 29 (.01524m = .6")
    retval = Part.SetUserPreferencedoubleValue(27, ".002032")
    retval = Part.SetUserPreferencedoubleValue(28, ".006096")
    retval = Part.SetUserPreferencedoubleValue(29, ".01524")


    'swDetailingArrowStyleForEdgeVertexAttachment = 38
    'swDetailingArrowStyleForFaceAttachment = 39
    'swDetailingArrowStyleForUnattached = 40
    'swOPEN=0, swCLOSED=1, swSLASH=2, swDOT=3
    'swORIGIN=4, swWIDE=5, swISOWIDE=6, swRUS=7
    'swCLOSETOP=8, swCLOSEBOT=9, swNO=10
    retval = Part.SetUserPreferenceIntegerValue(38, 1)
    retval = Part.SetUserPreferenceIntegerValue(39, 3)
    retval = Part.SetUserPreferenceIntegerValue(40, 10)

    'swDetailingVirtualSharpStyle = 41,
    'None = 0, Plus = 1, Star = 2, Witness = 3, Dot = 4
    retval = Part.SetUserPreferenceIntegerValue(41, 3)

    'swDisplayCosmeticThreads = 41
    'display threads = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(41, 1)

    'swDisplayDatums = 39
    'display datums = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(39, 1)

    'swDisplayDatumTargets = 40
    'display Datum Targets = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(40, 1)

    'swDisplayGeometricTolerances = 36
    'display Geometric Tolerances = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(36, 1)

    'swDisplayNotes = 35
    'display Notes = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(35, 1)

    'swDisplaySurfaceFinishSymbols = 37
    'display Surface Finish Symbols = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(37, 1)

    'swDisplayWeldSymbols = 38
    'display Weld Symbols = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(38, 1)

    'swDisplayOnlyInViewOfCreation = 56,
    'display Only In View = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(56, 0)

    'swDisplayAnnotations = 31
    'display Annotations = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(31, 1)

    'swDisplayAnnotationsUseAssemblySettings = 34
    'display Use Assembly Settings = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(34, 1)

    'swGridDisplay = 57,
    'display Grid = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(57, 0)

    'swGridDisplayDashed = 58, DOESN'T WORK
    'retval = Part.SetUserPreferenceToggle(58, 0)

    'swGridAutomaticScaling = 59, DOESN'T WORK
    'retval = Part.SetUserPreferenceToggle(59, 0)

    'swGridMajorSpacing = 30 (.0508m = 2")
    retval = Part.SetUserPreferencedoubleValue(30, ".0508")

    'swGridMinorLinesPerMajor = 42,
    retval = Part.SetUserPreferenceIntegerValue(42, 10)

    'swSnapToPoints = 60
    'Snap To Points = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(60, 0)

    'swSnapPointsPerMinor = 43 (# of snap points)
    retval = Part.SetUserPreferenceIntegerValue(43, 1)

    'swSnapToAngle = 61
    'Snap To Angle = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(61, 0)

    'swSnapToAngleValue = 31 (.785398164 rad = 45 deg)
    retval = Part.SetUserPreferencedoubleValue(31, ".785398164")

    'swUnitsLinear = 47
    'MM = 0, CM = 1, METER = 2, INCHES = 3, FEET = 4, FEETINCHES = 5
    retval = Part.SetUserPreferenceIntegerValue(47, 3)

    'swUnitsLinearDecimalDisplay = 48
    '1 = decimal, 2 = fractions
    retval = Part.SetUserPreferenceIntegerValue(48, 1)

    'swUnitsLinearDecimalPlaces = 49 (# of decimal places)
    retval = Part.SetUserPreferenceIntegerValue(49, 4)

    'swUnitsLinearFractionDenominator = 50
    '8 = 8ths, 32 = 32nds, etc...
    retval = Part.SetUserPreferenceIntegerValue(50, 16)

    'swUnitsLinearRoundToNearestFraction = 62
    '0 = don't round, 1 = round
    retval = Part.SetUserPreferenceToggle(62, 1)

    'swUnitsLinearFeetAndInchesFormat = 63
    '0 = 2'4", 1 = 2'-4"
    retval = Part.SetUserPreferenceToggle(63, 1)

    'swUnitsAngular = 51
    'DEGREES = 0, DEG_MIN = 1 DEG_MIN_SEC = 2, RADIANS = 3
    retval = Part.SetUserPreferenceIntegerValue(51, 0)

    'swUnitsAngularDecimalPlaces = 52 (# of decimal places)
    retval = Part.SetUserPreferenceIntegerValue(52, 1)

    'swImageQualityShaded = 44,
    'Coarse = 1, Fine = 2, Custom = 3
    retval = Part.SetUserPreferenceIntegerValue(44, 3)

    'swImageQualityShadedDeviation = 32 (.000508m = .02")
    retval = Part.SetUserPreferencedoubleValue(32, ".000253")

    'swImageQualityWireframe = 45,
    'Optimal = 1, Custom = 2
    retval = Part.SetUserPreferenceIntegerValue(45, 2)

    'swImageQualityWireframeValue = 46,
    'LOW=0, HIGH=100
    retval = Part.SetUserPreferenceIntegerValue(46, 85)

    If doctype <> swDocDrawing Then
    'swDisplayTextAtSameSizeAlways = 55
    'same Size = 1, varies = 0
    retval = Part.SetUserPreferenceToggle(55, 1)

    'swDisplayAnnotations = 31
    'display Annotations = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(31, 1)

    'swDisplayFeatureDimensions = 32
    'display feature dimensions = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(32, 0)

    'swDisplayReferenceDimensions = 33
    'display reference dimensions = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(33, 0)

    End If

    If doctype = swDocDrawing Then

    FontName = "Arial"

    'swDisplayFeatureDimensions = 32
    'display feature dimensions = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(32, 1)

    'swDisplayReferenceDimensions = 33
    'display reference dimensions = 1, don't = 0
    retval = Part.SetUserPreferenceToggle(33, 1)

    'line thickness
    'NONE = -1, THIN = 0, NORMAL = 1, THICK = 2
    'THICK2 = 3, THICK3 = 4, THICK4 = 5, THICK5 = 6
    'THICK6 = 7, NUMBER = 8, LAYER = 9

    'linetypes
    'CONTINUOUS = 0, HIDDEN = 1, PHANTOM = 2,
    'CHAIN = 3, CENTER = 4, STITCH = 5, CHAINTHICK = 6

    'swLineFontVisibleEdgesThickness = 53,
    'swLineFontVisibleEdgesStyle = 54,
    retval = Part.SetUserPreferenceIntegerValue(53, 1)
    retval = Part.SetUserPreferenceIntegerValue(54, 0)

    'swLineFontHiddenEdgesThickness = 55,
    'swLineFontHiddenEdgesStyle = 56,
    retval = Part.SetUserPreferenceIntegerValue(55, 0)
    retval = Part.SetUserPreferenceIntegerValue(56, 1)

    'swLineFontSketchCurvesThickness = 57,
    'swLineFontSketchCurvesStyle = 58,
    retval = Part.SetUserPreferenceIntegerValue(57, 0)
    retval = Part.SetUserPreferenceIntegerValue(58, 0)

    'swLineFontDetailCircleThickness = 59,
    'swLineFontDetailCircleStyle = 60,
    retval = Part.SetUserPreferenceIntegerValue(59, 0)
    retval = Part.SetUserPreferenceIntegerValue(60, 0)

    'swLineFontSectionLineThickness = 61,
    'swLineFontSectionLineStyle = 62,
    retval = Part.SetUserPreferenceIntegerValue(61, 0)
    retval = Part.SetUserPreferenceIntegerValue(62, 2)

    'swLineFontDimensionsThickness = 63,
    'swLineFontDimensionsStyle = 64,
    retval = Part.SetUserPreferenceIntegerValue(63, 0)
    retval = Part.SetUserPreferenceIntegerValue(64, 0)

    'swLineFontConstructionCurvesThickness = 65,
    'swLineFontConstructionCurvesStyle = 66,
    retval = Part.SetUserPreferenceIntegerValue(65, 0)
    retval = Part.SetUserPreferenceIntegerValue(66, 4)

    'swLineFontCrosshatchThickness = 67,
    'swLineFontCrosshatchStyle = 68,
    retval = Part.SetUserPreferenceIntegerValue(67, 0)
    retval = Part.SetUserPreferenceIntegerValue(68, 0)

    'swLineFontTangentEdgesThickness = 69,
    'swLineFontTangentEdgesStyle = 70,
    retval = Part.SetUserPreferenceIntegerValue(69, 0)
    retval = Part.SetUserPreferenceIntegerValue(70, 4)

    'swLineFontDetailBorderThickness = 71,
    'swLineFontDetailBorderStyle = 72,
    retval = Part.SetUserPreferenceIntegerValue(71, 0)
    retval = Part.SetUserPreferenceIntegerValue(72, 0)

    'swLineFontCosmeticThreadThickness = 73,
    'swLineFontCosmeticThreadStyle = 74,
    retval = Part.SetUserPreferenceIntegerValue(73, 0)
    retval = Part.SetUserPreferenceIntegerValue(74, 1)

    'swLineFontHideTangentEdgeThickness = 90,
    'swLineFontHideTangentEdgeStyle = 91,
    retval = Part.SetUserPreferenceIntegerValue(90, 0)
    retval = Part.SetUserPreferenceIntegerValue(91, 1)

    'swLineFontViewArrowThickness = 92,
    'swLineFontViewArrowStyle = 93,
    retval = Part.SetUserPreferenceIntegerValue(92, 0)
    retval = Part.SetUserPreferenceIntegerValue(93, 1)

    End If

    Part.EditRebuild

    Part.graphicsredraw2

    End Sub
     
    rmchugh, Aug 3, 2005
    #4
  5. BWelch

    BWelch Guest

    Ray

    That's a bull's-eye

    You've put a heck of a lot of work into it.
    It would have taken me weeks to decipher the syntax for those constants. I
    had a look at the info posted by Wayne, yesterday, and although the
    constants are there in the help files there's nill info about the syntax.

    Goofy help files:
    ( see "System Options" in VB help - but first type
    "swUserPreferenceDoubleValue" into the code area and press F1 to invoke
    help, then scroll down for "System Options" )


    I am in your debt for the code.




    Thanks Ray

    BW





    ................. clip
     
    BWelch, Aug 3, 2005
    #5
  6. BWelch

    BWelch Guest

    PS

    It works in SWK 2K5

    Funny thing, when I try to change the font in a table (BOM), only the
    last row is affected. However, the same behavior is observed when done
    manually from the menu.


    I've not yet checked the all of the settings adjustments, but so far it
    behaves as though a manual change had been implemented.



    nicely done

    thanks

    BW
     
    BWelch, Aug 4, 2005
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.