×
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 $PRPSHEET value with VB6 ?

Read $PRPSHEET value with VB6 ?

Read $PRPSHEET value with VB6 ?

(OP)
How can I read a $PRPSHEET value in VB6 ? I have tried the following without success:

----
Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.ActiveDoc
Customer_string = "$PRPSHEET:" & Ch(34) "Customer_dwg_name" & Chr(34)
Customer_dwg_name = Part.custominfo2("", "Customer_string")
MsgBox Customer_dwg_name
----
The MsgBox returns nothing. It does not work for standard SW properties. It does not work with $PRP values either.
This does work very nicely for normal custom properties.

RE: Read $PRPSHEET value with VB6 ?

(OP)
Bradley;
Thanks for reply. I'm not sure where the difference is in your suggestion. Do mean the part.custominfo will work, whereas part.custominfo2 (as in my example) does not work ?
I suspect my problem is in the "Set Part = swApp.ActiveDoc" area, because I think this information is contained in the active sheet or view, or something.
Thanks, Don.

RE: Read $PRPSHEET value with VB6 ?

"I suspect my problem is in the "Set Part = swApp.ActiveDoc" area, because I think this information is contained in the active sheet or view, or something."

Yep, that's it.  You just need to drill down a bit further into the swApp.ActiveDoc object and grab the drawing sheet.  Sorry I don't know the specific call but it's definitely in the API help file.

Chris Gervais
Mechanical Designer
American Superconductor

RE: Read $PRPSHEET value with VB6 ?

DMichaels

I think that ModelDoc.CustomInfo2() is only for part properties, not for drawing properties.

Mabe you should try DrawingDoc.GetSheetNames(), with the drawing as active doc.

Regards

RE: Read $PRPSHEET value with VB6 ?

I know this is an old thread but I ran across it in search of another old thread.

I have only just begun to research drawing properties but the best I can figure is that $PRPSHEET:"property" refers to custom properties belonging to the model whereas $PRP:"property" refers to custom properties belonging to the drawing.  $PRPSHEET: and $PRP: are just used in the drawing format to tell SolidWorks where to get the custominfo from.  They are not included when getting the info via an API call.  In the case of the original question, fieldname would be "Customer_dwg_name"

To get the custom property from the model, I believe you have to make the model the active document then use the ModelDoc.GetCustomInfo2 (configuration, fieldname) API call to retieve it.

ModelDoc.GetCustomInfo2 (configuration, fieldname) can be used on a drawing but since it does not contain configuration specific custom properties, the configuration parameter is set to an empty string.  I generally use ModelDoc.GetCustomInfo2 ("",fieldname).

Oh yes, Models and Assemblies can also use non configuration specific custom properties.  It all depends on what information you want to store and whether it pertains to all configurations or an individual configuration.




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