21 | 08 | 2017

(Dim) Scalefactor

Below a function is show that sets the scalefactor of Acadobjects. The samples shows how to set the Dim Scale. All dimension objects are filtered out and a scalefactor is applied.

Function ScaleDim(ByVal scalefactor As Double)
    Dim iType(0) As Integer
    Dim vValue(0) As Variant
    Dim sSet As AcadSelectionSet
    Dim aEntity As AcadEntity
    Dim iCount As Integer
    On Error Resume Next
    'Filter all dimension objects and add them to a selection set
    iType(0) = 0
    vValue(0) = "DIMENSION"
    Set sSet = ThisDrawing.SelectionSets.Add("DIMENSIONS")
    sSet.Select acSelectionSetAll, , , iType, vValue
    For Each aEntity In sSet
    'Set the scale factor
    aEntity.scalefactor = scalefactor '''overall scale
    iCount = sSet.Count
End Function

Sign up now and upload your code to the website.

Help us to continue.....
Articles View Hits
Latest Articles