×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

read a note content in visual basic

read a note content in visual basic

read a note content in visual basic

(OP)
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

RE: read a note content in visual basic

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

RE: read a note content in visual basic

(OP)
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)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources