home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "modPS"
- '******************************************************************'
- '* *'
- '* TurboCAD for Windows *'
- '* Copyright (c) 1993 - 2001 *'
- '* International Microcomputer Software, Inc. *'
- '* (IMSI) *'
- '* All rights reserved. *'
- '* *'
- '******************************************************************'
-
- Option Explicit
-
- Sub EnumPaperSpaces()
- On Error GoTo PSError
- Dim pss As GXMPSLib.PaperSpaces
- Dim ps As GXMPSLib.PaperSpace
- Dim grs As Graphics
- Dim gr As Graphic
- Dim props As Properties
- Dim prop As Property
- Dim dwg As Drawing
- Dim i, j As Integer
- Dim dumpfile As String
-
- Set dwg = ActiveDrawing
- Set pss = dwg
- Debug.Print pss.count & " PaperSpaces"
- On Error Resume Next
-
- 'For Each does an infinite loop
- 'For Each ps In pss
- For i = 0 To pss.count - 1
- Set ps = pss(i)
- Debug.Print "Name: " & ps.Name
- With ps.RelativeOrigin
- Debug.Print "RelativeOrigin: (" & .x & ", " & .y & ", " & .z & ")"
- End With
-
- Set grs = ps.Graphics
- Debug.Print grs.count & " Graphics"
- For Each gr In grs
- Debug.Print "Type: " & gr.Type
- Next
-
- dumpfile = "d:\" & ps.Name & "_props.txt"
- Open dumpfile For Output As #1
-
- ps.Activate
- Print #1, "Print Space Properties ----------"
- PrintPropertiesToFile ps.Properties
- Print #1, "Drawing Properties ----------"
- PrintPropertiesToFile ps.Properties
-
- Close #1
-
- Next
- Exit Sub
-
- PSError:
- MsgBox "Error: " & Err.Description
- End Sub
-
- Sub EnumGraphicsInAllSpaces()
- On Error Resume Next
- Dim mode As Integer
-
- mode = ActiveDrawing.Properties("TileMode")
- ActiveDrawing.Properties("TileMode") = 1
- Debug.Print "Model Space"
- EnumGraphicsInCurrentSpace
- ActiveDrawing.Properties("TileMode") = 0
- Debug.Print "Paper Space"
- EnumGraphicsInCurrentSpace
- ActiveDrawing.Properties("TileMode") = mode
- End Sub
-
- Sub EnumGraphicsInCurrentSpace()
- On Error Resume Next
- Dim m As Matrix
- Dim i As Integer
- Dim gr As Graphic
- Dim grs As Graphics
- Set grs = ActiveDrawing.Graphics
- i = 0
- For Each gr In grs
- i = i + 1
- Debug.Print i
- Debug.Print gr.Type
- Set m = Nothing
- Set m = gr.UCS
- If Not m Is Nothing Then
- Debug.Print m
- Else
- Debug.Print "no UCS"
- End If
- Next
- End Sub
-
- Sub DumpDrawingPropertiesBothSpaces()
- On Error Resume Next
- Open "J:\dwgprops.txt" For Output As #1
- ActiveDrawing.Properties("TileMode") = 0
- Print #1, "Tile Mode 0 ---------------"
- DumpDrawingProperties
- ActiveDrawing.Properties("TileMode") = 1
- Print #1, "Tile Mode 1 ---------------"
- DumpDrawingProperties
- Close #1
- End Sub
-
- Sub DumpDrawingProperties()
- On Error Resume Next
- Dim i, count As Integer
-
- count = ActiveDrawing.Properties.count
- Print #1, count & " Properties:"
- Dim prop As Property
- i = 0
- For Each prop In ActiveDrawing.Properties
- i = i + 1
- Print #1, i
- DumpProperty prop
- Next
- End Sub
-
-