JoeMoss
Mechanical
- Mar 8, 2006
- 37
I think I have an easy one here, but we will see. I know how to get custom properties from my model when my ActiveDoc is the model: SwModel.CustomInfo2(). How do I get to the custom properties if my drawing is my ActiveDoc?
I am working in the drawing and trying to update the title block, but I am having troubles getting the info to put in the title block.
Thanks!
Joe
Here is the codes I am working with:
Public Sub SetNoteText1()
Dim DrwDoc As SldWorks.ModelDoc2
Dim View As SldWorks.View
Dim Note As SldWorks.Note
Dim NoteText As String
Dim BoolStatus As Boolean
Dim NoteHgt As Double
Dim NoteAHgt As Double
NoteAHgt = 0#
Set DrwDoc = swApp.ActiveDoc
Set View = DrwDoc.GetFirstView()
Do While Not View Is Nothing
Set Note = View.GetFirstNote()
Do While Not Note Is Nothing
NoteHgt = Note.GetHeight()
NoteText = Note.GetText()
Select Case NoteText
Case "<COMPANY NAME>"
BoolStatus = Note.SetText("XYZ Co." & vbCrLf & vbCrLf & "COMPOSITE BEAM")
Case "<DRW>"
BoolStatus = Note.SetText("AUTO")
Case "<Order Number>"
BoolStatus = Note.SetText(Word)
Case "WEIGHT:"
BoolStatus = Note.SetText("WEIGHT: X LB")
Case "A"
NoteAHgt = NoteHgt
BoolStatus = Note.SetText("A " & " NB 001")
Case Else
End Select
Set Note = Note.GetNext()
Loop
Set View = View.GetNextView
Loop
End Sub
I am working in the drawing and trying to update the title block, but I am having troubles getting the info to put in the title block.
Thanks!
Joe
Here is the codes I am working with:
Public Sub SetNoteText1()
Dim DrwDoc As SldWorks.ModelDoc2
Dim View As SldWorks.View
Dim Note As SldWorks.Note
Dim NoteText As String
Dim BoolStatus As Boolean
Dim NoteHgt As Double
Dim NoteAHgt As Double
NoteAHgt = 0#
Set DrwDoc = swApp.ActiveDoc
Set View = DrwDoc.GetFirstView()
Do While Not View Is Nothing
Set Note = View.GetFirstNote()
Do While Not Note Is Nothing
NoteHgt = Note.GetHeight()
NoteText = Note.GetText()
Select Case NoteText
Case "<COMPANY NAME>"
BoolStatus = Note.SetText("XYZ Co." & vbCrLf & vbCrLf & "COMPOSITE BEAM")
Case "<DRW>"
BoolStatus = Note.SetText("AUTO")
Case "<Order Number>"
BoolStatus = Note.SetText(Word)
Case "WEIGHT:"
BoolStatus = Note.SetText("WEIGHT: X LB")
Case "A"
NoteAHgt = NoteHgt
BoolStatus = Note.SetText("A " & " NB 001")
Case Else
End Select
Set Note = Note.GetNext()
Loop
Set View = View.GetNextView
Loop
End Sub