이 매크로를 만들게 된 이유는 Batch Converter로 변환 시 Dgn에서 Off된 Level도 Dwg로 변환 시 모두 On이 되기 때문입니다.
Dgn에서 Off된 Level를 찾아 저장 후,
Dwg로 변환하고 나서 저장한 Level과 같은 이름의 Level를 찾아 Off시키도록 했습니다.
- Macro File -
#----------------------------------------------------------------------
#
# Command file for batchprocess utility
#
# This command file was originally copied from $(MS_DATA)cmdfiletemplate.txt.
# Command file information:
# - Lines that start with the '#' character are treated as comments and ignored.
#
#----------------------------------------------------------------------
vba run ConvertWithoutUnvisibleLevel
Dgn에서 Off된 Level를 찾아 저장 후,
Dwg로 변환하고 나서 저장한 Level과 같은 이름의 Level를 찾아 Off시키도록 했습니다.
- Macro File -
Sub ConvertWithoutUnvisibleLevel() RemoveLevel = False Dim oLevels As Levels Dim oLevel As Level Dim oView As View Dim oOffLevel(10) As String Dim counter(2) As Integer, iOffLevelCount Set oLevels = ActiveDesignFile.Levels Set oView = ActiveDesignFile.Views(1) counter(0) = 0 iOffLevelCount = 0 Do While counter(0) < oLevels.Count counter(0) = counter(0) + 1 Set oLevel = oLevels.Item(counter(0)) If True <> oLevel.IsDisplayedInView(oView) Then oOffLevel(iOffLevelCount) = oLevel.Name iOffLevelCount = iOffLevelCount + 1 End If Loop ActiveDesignFile.SaveAs ActiveDesignFile.FullName + ".dwg", True, msdDesignFileFormatDWG Set oLevels = ActiveDesignFile.Levels Set oView = ActiveDesignFile.Views(1) counter(0) = 0 counter(1) = 0 Do While counter(0) < oLevels.Count counter(0) = counter(0) + 1 Set oLevel = oLevels.Item(counter(0)) counter(1) = 0 Do While counter(1) < iOffLevelCount If oOffLevel(counter(1)) = oLevel.Name Then oLevel.IsDisplayedInView(oView) = False End If counter(1) = counter(1) + 1 Loop Loop End Sub
- Command File -#----------------------------------------------------------------------
#
# Command file for batchprocess utility
#
# This command file was originally copied from $(MS_DATA)cmdfiletemplate.txt.
# Command file information:
# - Lines that start with the '#' character are treated as comments and ignored.
#
#----------------------------------------------------------------------
vba run ConvertWithoutUnvisibleLevel
댓글
댓글 쓰기