除此之外,这里是更新名为“titleblock”的块的代码,我已经注意到了将属性导出到excel的点。这是一个开始。
- Public Sub issued_for_construction()
- ' This Updates the Issued for construction and sets rev 0
- Dim SS As AcadSelectionSet
- Dim Count As Integer
- Dim FilterDXFCode(1) As Integer
- Dim FilterDXFVal(1) As Variant
- Dim attribs As Variant
- Dim BLOCK_NAME As String
- On Error Resume Next
- FilterDXFCode(0) = 0
- FilterDXFVal(0) = "INSERT"
- FilterDXFCode(1) = 2
- FilterDXFVal(1) = "titleblock"
- BLOCK_NAME = "titleblock"
- Set SS = ThisDrawing.SelectionSets.Add("issued")
- SS.Select acSelectionSetAll, , , FilterDXFCode, FilterDXFVal
- For Cntr = 0 To SS.Count - 1
- attribs = SS.Item(Cntr).GetAttributes
-
- ' take these next 4 lines out and add your export to excel here !
- attribs(0).TextString = "ISSUED FOR CONSTRUCTION"
- attribs(3).TextString = "0"
-
- attribs(0).Update
- attribs(3).Update
-
- Next Cntr
- ThisDrawing.SelectionSets.Item("issued").Delete
- 'DO AGAIN FOR REVTABLE
- 'DATE
- 'Dim MyDate
- 'MyDate = Date
- Call DashDate
- FilterDXFCode(1) = 2
- FilterDXFVal(1) = "REVTABLE"
- BLOCK_NAME = "REVTABLE"
- Set SS = ThisDrawing.SelectionSets.Add("revs")
- SS.Select acSelectionSetAll, , , FilterDXFCode, FilterDXFVal
- For Cntr = 0 To SS.Count - 1
- attribs = SS.Item(Cntr).GetAttributes
-
-
- attribs(0).TextString = "0"
- attribs(1).TextString = DashDate
- attribs(2).TextString = "ISSUED FOR CONSTRUCTION"
-
-
-
- attribs(0).Update
- attribs(1).Update
- attribs(2).Update
-
- Next Cntr
- ThisDrawing.SelectionSets.Item("revs").Delete
- MsgBox "Drawing now changed to Issued for Construction"
- End Sub
- Public Function DashDate() As String
- Dim strDate As String
- Dim intMonth As Integer
- Dim intDay As Integer
- strDate = Str(Date)
- intMonth = InStr(1, strDate, "/", vbTextCompare)
- intDay = InStr(intMonth, strDate, "/", vbTextCompare)
- strDate = Left(strDate, intMonth - 1) & "." _
- & Mid(strDate, intMonth + 1, intDay - 1) & "." & Right(strDate, 2)
- DashDate = strDate
- End Function
|