Community Tip - You can change your system assigned username to something more personal in your community settings. X
I don't know if this is possible.
I'm creating a library of electronic resistors that are identified with colour bands.
There are potentially a few hundred to create which would be an incredibly laborious task.
Is there a way to assign a variable for each colour and then have some kind of automated / macro / script that will generate (create and save as a STEP file) a list of parts by providing a table of values for each of the variable colours?
Each resistor has between 3 and 5 colour bands (example below has 4).
Solved! Go to Solution.
Hello Xavier,
The Pro/PROGRAM functionality should be a basic functionality which is always available (under Tools > Model Intent > Program), but it's not so often used.
It's like simple programming of parts, expanding relations by adding the option to prompt user input and suppress/resume features by conditional statements. So you can calculate parameters based on input and then modify or suppress features based on the calculation. Makes designs very flexible.
But since you probably need the parts only once to export them and then probably never again, I agree that it may be easiest to change the export files (if you know where you need to change them).
Anyway, FYI I attached a very simple example model (colors are applied to different offset surfaces):
Regenerate to get the GET INPUT menu, select Enter to change design, checkmark parameters to change (there is only one for simplicity) and enter color following the prompt
Regards,
Gunter
Thanks Martin, that's an interesting thought.
After initially struggling to get the colours in the STEP Exports (Creo doesn't default to the AP214 format, you have to define it in the preferences), it looks like this could be the easiest way...
Do you need them to be STEP files, or would you prefer to keep them native Creo files?
It seems like it would be pretty easy to add multiple color surfaces to the model and then turn them on and off with either Pro/PROGRAM and relations or a family table.
I'd need STEP files - the external program I'm using for 3D visualisation requires STEP models.
The alternative is to try and do something with FreeCAD and CadQuery where you can write parametric python scripts to generate various geometric shapes. It's what's been used to do a long list of surface mount electronic components. But the libraries don't include vertically mounted through-hole resistors which is what I need.
I could try and get my head around creating python scripts, but as I use Creo for my enclosure designs and other 3D modelling, I though I could do them here.
But it sounds like it's a relatively complex process and if I'm going to have to learn another part of Creo which I don't know yet, it might be easier for me to do it directly with CadQuery / python scripting.
Thanks Gunter. In the end, I changed the STEP export format to AP214, so I have all the colour information in the files.
Right now, I've found out it's easier to manually edit the STEP files, changing the colour information in there. That's probably simpler than using trial files - but thanks for your suggestion
I'll have to ask my colleagues, but I don't think I have the Pro/PROGRAM feature in my install, so it may be all academic.
In the long run, if we want several hundreds of parts, I'll figure out how to do it with some python scripts as the whole cadquery toolset should be capable of doing it.
Hello Xavier,
The Pro/PROGRAM functionality should be a basic functionality which is always available (under Tools > Model Intent > Program), but it's not so often used.
It's like simple programming of parts, expanding relations by adding the option to prompt user input and suppress/resume features by conditional statements. So you can calculate parameters based on input and then modify or suppress features based on the calculation. Makes designs very flexible.
But since you probably need the parts only once to export them and then probably never again, I agree that it may be easiest to change the export files (if you know where you need to change them).
Anyway, FYI I attached a very simple example model (colors are applied to different offset surfaces):
Regenerate to get the GET INPUT menu, select Enter to change design, checkmark parameters to change (there is only one for simplicity) and enter color following the prompt
Regards,
Gunter
Ah great, I'll look at understanding how that works, but from your cube example, it wouldn't take me that long to rattle through the 20 or so important colour sets I need right now.
That's great. Thanks
edit: is it possible to take this one step further and somehow script / macro it so that the "questions" it asks (which of course you requested in the programming) can be answered by a parameters file or table? If it's possible to do that and then save the component using a filename in the parameters file / table, then you could automate the process.
edit2: learning to walk before attempting to run looking at the program, I can see that chosing a colour calls up a different feature ID: red = internal feature ID 82, green = 105, etc.
I can't see where we assign the colour to the internal feature ID. Could you please point me in the right direction? I'll then be able to adapt to my resistor model.
Thanks again!