Firstly, I am concentrating only on SJP (SolidWorks Job Pricing).
Currently I have not really touched assemblies I am currently concentrating fully on parts only.
I have found that there is no API function to get the mass / volume / weight of a feature within a part. Luckily the way around this is that you can exclude suppressed features from the calculation of mass. So at the product I am implementing the following algorithm;
1. Iterate through all features for a part.
2. Save material type for part when detected
3. For the first feature that is type extrude save this feature as the Blank feature.
3a. Supress the Blank feature and all of its children (ie all other cuts etc).
3b. Unsuppress the Blank itself so that it is now the only feature unsupressed.
3c. Get model mass and save this away as the "blank" weight.
4. For each subsequent feature:
4a. Unsupress feature
4b. Get model mass
4c. Feature mass = Blank mass - current model mass
FutureAll of this should be done by tomorrow - after that is:
1. the relatively easy job of associating a price with a material
2. the relatively easy job of associating a multiplier with a machining operation type (ie cut , grind etc)
3. the harder job of handling folders to deliniate operator handling.
4. the untested job of processing assemblies of parts and then assemblies of assemblies of parts.
5. working out how to actually put new buttons into SW to actually execute and display job information and what format that should take.
Following are the notes that I made from last weeks meeting. They will act as a road map for what I should be doing.PART A
1 get material type
2. get mass of raw material -> raw material cost
---------------------------------------------------
PART B
1. Calculate the volume of a cut
2. return type of cut (grinding, milling, fillet, chamfer and ribs) based on naming conventions
---------------------------------------------------
PART C
1 FOLDERs - used to work out positioning charges
----------------------------------------------------
PART D
Calculate cost for the part
----------------------------------------------------
Part E
Iterate part costing process for entire assembly and produce final cost
ISSUES
Where are costs held for
raw materials
positioning
various cuts
Progress Report,
Today is already Thursday and only now have I been able to extract dimension information from the model. So at this point I can navigate the feature tree and pull out dimensions, this sounds like I am 3/4 there - however I am definitely NOT.
Currently I cant tell what i am getting dimensions of, so the next major task is to extract what exactly the dimensions mean. For example I can not at the moment tell whether an extrusion is based on a round object(circle) or a rectangular one.
The main reason I lost so much time this week is I got quite a bit of confusion from the fact that the API and its documentation still contains a lot of function calls tht have been deprecated. You can be reading some example code in the doco and not know that it contains deprecated commands. Also all of the examples are in VB and I have to convert them to C#.
My preliminary investigations tell me that find a description of what the dimensions are of may be quite difficult.
Accomplished
1. run solidworks and build a model
2. write a C# program to reach into an active session in SW's and add a component to a model (proving that C# seems ok for the job)
3. wrote a C# program that can go through the feature tree and pick out the major components of the tree (feature name and type).
To Do List
1. Write a routine to do a comprehensive extraction of information (materials, dimensions etc).
2. Work out how to implement a program into the SolidWorks menu structure or create a toolbar that can be inserted into SolidWorks to actually kick off the program we are trying to write.
3. Work out an algorithm with George that will manipulate the info we extract from the tree and pricing info stored on tables.
4. Write and implement the actual program.
Today I worked soley on the SolidWorks job pricing program. I have created a program that can go through a model and can (at least at a very rudimentary level) traverse the features tree picking out basic information like feature type and name. I can not as yet get such specific information as sizes of extrusions.
I think I will need to get hold of a model that has an assembly containing more than one part.
I will email a version of this latest program along with a model to run it on.
NOTE - if you want to leave a note for me regarding this or any entry remember that you can leave a comment.
Today I only worked on SolidWorks. I got more serious and started to read the API documentation and investigate whether C# is a valid language for manipulating SolidWorks. It seems that it is ok although i think most development is in VB. I was also worried that my development evironement which is based on .net 1.1 would be inadequate now that .net 2.0 has been released - this turned out not to be the case - .net 1.1 seems to be fine so far. As a precaution i have downloaded .net 2.0 and a new IDE from microsoft.
I successfully compiled and ran a program in C# that made a small modification to a pre-existing model that I had opened in SolidWorks
Gary
Didnt do any work on PLE today - spent the entire day starting to play around with SolidWorks. Did the tutorials and started poking around the documentation.