Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

read a note content in visual basic

Status
Not open for further replies.

dogarila

Mechanical
Oct 28, 2001
594
In my title block I have a note for the Job Number. The note is $PRPSHEET:"Job No" and is linked to a custom property in the Part. How do I read the actual content of the note into a VB program to be able to inserted into a text box on a form?

Netshop21
 
Replies continue below

Recommended for you

Hi

The following code is used to copy the existing settings of a set of custom properties to a form. Hopefully will guide you to a starting point.

Sub LoadCustInfo()
Set swApp = CreateObject("SldWorks.Application")
' Attach to or open SolidWorks session
Set Model = swApp.ActiveDoc ' Grab the current document

frm1.Issue.Text = Model.CustomInfo2("", "Issue")
frm1.Drawingno.Text = Model.CustomInfo2("", "KETDDrg")
frm1.Desc1.Text = Model.CustomInfo2("", "Descline1")
frm1.desc2.Text = Model.CustomInfo2("", "Descline2")
frm1.desc3.Text = Model.CustomInfo2("", "Descline3")
frm1.cusdraw(0).Text = Model.CustomInfo2("", "Custdrg")
frm1.Datecomp(1).Text = Model.CustomInfo2("", "Date")
End Sub

Regards


Kevin
kevin@ketd.co.uk
 
Thank you for your answer, Kevin. But I still need some help. The note I am trying to read is text on the drawing (it is generated by a link to the 3d model and defined as shown above). I am trying to read it while the drawing is active, not the part. It is not a custom property in the drawing.

Is it posible to modify the value of a custom property by linking it to an external model?

Andrew (Netshop21)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor