×
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

API Routine needed (please)

API Routine needed (please)

API Routine needed (please)

(OP)

I am trying to produce a simple CAPP program for an assignment at university, but have hit a brick wall.  I need to be able to capture the features and their associated information (Type, dia, length, width, depth, etc) using an API routine, that I can then import/link into an Access database.  Is there anyone out there that can help me or at least steer me in the right direction.  I have tried to use a design table, but this process requires too much manual input, and as a result it is not reliable.
PLEASE HELP ME!!

RE: API Routine needed (please)

This is all going to depend on the features that you want information from. Your question is not detailed enough to provide a sample, but here is some of the methodology you may need to use.

Method 1:
If you are simply trying to extract dimensions and custom properties from a part, drawing or assembly, you can use the GetSystemValue2 and GetCustomInfo methods to retrieve the values.

Method 2:
If the user is going to select the feature, then you can use the SelectionManager method in conjunction with the GetSelectObjects3 method to trap the selected object. From there, you can extract the properties of the features. If this is all going to be automatic, you will have to traverse through the design tree, capturing the information you want.

You may have to validate the geometry of the selected item using the GetSelectedObjectType2 method which references the swSelectType_e enumeration.

Once you have identified the feature, you can use the individual feature objects to extract the information.

Needless to say, this can be quite a hefty task. There should be plenty of examples in the SolidWorks API Help that can help you through the process.

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

RE: API Routine needed (please)

(OP)
Dis
Firstly thankyou for such a prompt reply.

Secondly, in answer to your question, The type of features I will need to carry out this assignment are Holes, Pockets, Steps, Boss, Rib, Fillet, Chamfer, ect (these I have classified as Main Features) the next type of information I would need to know is the type of sub Feature (Through, Blind, composite, Isolated or Chain) once i have been able to establish what is what, i will then need to obtain the relevant dims associated with each sub feature.  Hope this makes my initial enquiry/plea a little more easier to understand.

As for now, I will attempt to write some form of API routine using the information you have so kindly supplied. (although I'm dreading it a little due to the fact that the only programming I have done to any extent has been with AutoLISP)

RE: API Routine needed (please)

Bootneck:

Looks like you have a pretty large task ahead. If these features are consistantly labeled in the design tree, it would be much easier to traverse through that. Then, once you hit a particular feature, you can get the values you need. There are several samples in the SolidWorks install that illustrate the process of traversing through the design tree. Unfortunately, this project is going to take some significant time. Needless to say, I don't have that much free time to whip up a solution for you. However, if you have any specific questions while progressing through this project, just post them here.

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

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