×
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

Push/Pull Custom Props with MS Access

Push/Pull Custom Props with MS Access

Push/Pull Custom Props with MS Access

(OP)
I am trying to Push/Pull Custom Props with MS Access...does anyone have any suggestions or sample code to get me started? I looked at the SW help file for AddCustomInfo3, I just don't understand how to link the 2 programs. I have been trying to put the code in Access and push the info into SW (file is open)...no luck! I have built quite a few database but have never linked to another program (like SW).

TIA,

DT

RE: Push/Pull Custom Props with MS Access

Not sure about Access, but I've written a macro in Excel that pulled info from solidworks.  You have to 'link' to SW with the following placed at the beginning of your code:

Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.ActiveDoc


Note: this was written in SW2001+ and unfortunately I haven't written anything in 2003 (i.e. there might be a better way).

RE: Push/Pull Custom Props with MS Access

It comes down to having two separate application object: one for SW and one for Access.  Each has its own API (sets of objects, methods, properties, accessors).  Think of the VB program as the communicator between the two applications.

Bring SW properties into VB variables using modeldoc2.customino().  Then set the Access database properties from the VB variable.  The reverse for Access to SW.

Also important: AddCustomInfo does not overwrite existing properties.  If necessary to overwrite, follow up with modeldoc.CustomInfo().

Good and evil: wrap them up and disguise it as people.

RE: Push/Pull Custom Props with MS Access

A little foreshadowing from The Tick.....

Stick arond a day or two and you will see a post regarding a macro that copies custom info that I will be posting for general distribution.

Good and evil: wrap them up and disguise it as people.

RE: Push/Pull Custom Props with MS Access

(OP)
ok...thanks

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