What's new

Anyone have working API examples?

Anyone have working API examples?

Are there any working API examples out there that anyone is willing to share?

Anyone at Alibre willing to show us how you would like the code to be organized? After all you would hope we would make them available for you to post to help others.

While I am learning Alibre and brushing up on my Visual Basic, I don't have too much time to bang my head against the wall trying to get everything right for my first program to run.

I want to start small and put together a set of learning examples on just basic part creation (blocks), and move on from there. I will be using Visual Basic as I think it will be the easiest language for non-programmer type users to get into API programming, and in which I wish to create sample files.

While I do not see a direct integration into Alibre at this time, running these programs outside of Alibre would create Parts or Features, and maybe Assemblies.

Visual C or Visual Basic examples are welcome.

Thanks,
Kirk Kelsey
 

rbrian

Senior Member
Re: Anyone have working API examples?

KirkKelsey said:
Are there any working API examples out there that anyone is willing to share?
...
I want to start small and put together a set of learning examples on just basic part creation (blocks), and move on from there. I will be using Visual Basic as I think it will be the easiest language for non-programmer type users to get into API programming, and in which I wish to create sample files. Thanks,
Kirk Kelsey

Kirk - do you mean you want to use the API to generate some code that will autmatically create a cube or box of x,y, z dimensions?

I thought a good thing to create and not too hard, would be a version filter or converter - so a user with newer program could interact with users who have not got V8 - so you could export a file or stp version, run the filter/convert - and out would come - a V6.0 or V7.0 compatible file!

I had to edit a .stp file myself - and make some changes in it so I could read it - and it worked - so I know it can be done and should not be too hard! basically a global search and replace for 2 or 3 different lines in there!

Thanks for your efforts! Robert
 
Simple API examples

Yes, I would like to start with simple example parts like a cube, and then move on from there. This would be help for the non-programmer (or rusty programmer in my case) to work into more complicated uses of the API.

I learn the fastest by analyzing examples of existing code. The first thing being a "template" in which to write code with all the appropriate sections outlined and commented. I tend to comment my code extensively as a memory refresher, and for those that follow that want to maintain or modify the code. A lot of times even I have a hard time remembering what I was trying to accomplish on the day that I wrote that code.

Interesting thought on version compatibility problems. I had not even considered this problem as Alibre is evolving so rapidly, I would be hard pressed not to keep up with maintenance so as to have the latest enhancements. The affordable nature of the maintenance was a large factor in choosing Alibre. I wonder where that information about file formats would be quantified (but that would be another topic for a post).

I have been looking at the .stp and Alibre part and assembly files themselves in order to do part information extraction for a detailed intelligent bill of material. So many exciting things to do, all I need is more time.

Kirk Kelsey
 
API example in the Binaries section

An API program under deveopment has been posted in the Binaries section on 10 Mar 2005 for converting Step files from Version 8 to 7.

It looks like it addresses the interest of converting STEP files, and will hopefully give me that foothold to hone my rusty programming skills.

Thank you Alibre for the Digest ability so that I can keep up with activity in the forum.
 

modtek

Member
API for sketch properties

Hello

I have not seen any fedback to my earlier API example (stp conversion from v8 to v7). So I do not know if it works or if it will be useful or not.

dosterberg has mentioned about finding sketch properties in his post dated 2/15/05(Enhancements Forum)

A VB module (properties.zip) is posted in "Binaries". It finds out perimeter for a sketch
(with 4 lines). Name the part (containing the sketch) as "sketch.ad_prt" and place it in a folder " C:\\api".

It will be possible to develop other modules to calculate area, c.g,radius of gyration etc. in a similar way depending on the feedback from experts.

With regards
modtek
 
Feedback and Thank You on posted API examples

Thank you modtek for posting the API examples.

I have downloaded them and reinstalled my Visual Basic 6 so that I can play with them. It has been some time since I last did any programming and it will take me a little time to get back up to speed. This will help me get back into VB world as my last project was in yet another propietary language based on C.

Are you interested in writing custom programs for others? I would like to work with the API, but right now my priorities with Alibre is documentation of methods and techniques for woodworking. (Just finished my first Cabriol leg and Boolean Intersection in Alibre-That was fun(whew)).

I really need a way to automatically extract all the information from the equation editor (or at least specified named variables) for all part files in a given folder. This information (.CSV file?) would then be integrated into a spreadsheet for BOM data.

You can contact me as kirkkelsey via the Alibre Message Center.

Thank you again for giving me some VB code to study.
 
Top