Standing
Mechanical
- Jan 14, 2002
- 1,578
Using SW 2005 & VB6 I am trying to read "$PRP:" & Chr(34) & "SW-File Name" & Chr(34) as a value that I can compare to our BOMnumber. What I get in the text box is "$PRP:" & Chr(34) & "SW-File Name" & Chr(34). What I am looking for is the value for SW-File Name. It shows up in the model properties just fine as:
Property Name Type Value / Text Expression Evaluated Value
PartNo1 Text $PRP:"SW-File Name" 645998
Anyone have an idea how I can set PartNo1 equal to the file name?
Bradley
Property Name Type Value / Text Expression Evaluated Value
PartNo1 Text $PRP:"SW-File Name" 645998
Anyone have an idea how I can set PartNo1 equal to the file name?
Code:
Option Explicit
Const swDocPART = 1
Const swDocASSEMBLY = 2
Const swDocDRAWING = 3
Dim PartNo1 As String
Dim PartNoUpdate As String
Private Part As Object
Private Sub Form_Load()
Dim swApp As Object
Dim Model As Object
Dim Part As Object
Dim RetVal As Boolean
Dim PartNo1 As String
Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.ActiveDoc
Set Model = swApp.ActiveDoc
PartNo1 = "$PRP:" & Chr(34) & "SW-File Name" & Chr(34)
txtPartNo1.Text = PartNo1
End Sub
Bradley