I programmed a python code which ask for a range of parameters to create a cmd file that "produces" somekind of a skateboard with a handle. I want the board to be flexible so I was hoping to "just add" "part create flexible_body..." Problem here is that I can't write the necessary *.mnf-file. So I tried recording a macro and replacing parts with variables as I did before to write the other parts of the model.
But when I try to replay that recorded macro it won't set the material to wood instead of steel and it won't set the element type to shell instead of solid. Eventhough I did theses changes while recording the macro.
I don't have enough insight into the commands within the macro file, so I am not able to "just sort it out" and find the proper lines within these 10000 lines of code.
I'd be very thankful if anyone of you has an idea or even solution to my problem!
Thanks a lot and let me know if you need more information!!
You make life very complicated for you. 10000 lines of code to build a model does not seem to be the right way of doing this. Normally you would use ADAMS/View to build your model, then save it as a binary file. Then you can use a cmd-file to change parameters, for example for an optimization by an external code such as HEEDS. But writing Python code to generate a cmd file that then builds the model? Seems like going over the creek to get water.
PS. Latest versions of ADAMS has (limited) Python capabilities for building the model without having to use cmd files.
PPS. If you want flexibility, you can create that inside ADAMS/View if you have a solid for the part you need to make flexible.
The Python Code asks the User for several different parameters. Then these parameters are written into the cmd File. So I don't need to pay for extra software...like HEEDS.
As my python code generates the cmd file I don't need adams to support python.
Concerning the flexible bodies, I know that I can do the "make flexible" procedure manually after having generated the cmd file. But I need this to happen automatically.
For example:
"last line of cmd file": "make flexible...parameters: shell elements, material, shel thickness...."
or
"last line of cmd file": "call pre-written macro with a bunch of variables, like shell elements and shell thickness"
Normally you would build a parameterized model in View and create a dialog box where the user can change the parameters instead of recreating the model each time you need to change a parameter.
You don't use HEEDS to build a model, you use it to optimize a model. So it was just an example on how you normally would use a cmd-file.
So if you don't want to have a model in View to work with, keep trying to adjust your 10000 line Python code until it works. I thought that was your underlying problem.
But if you want any help, at least post the part of the cmd-file that gives you problems.
And if you don't want to use View, why don't you then build the adm-file directly from the Python code? That was how we used to do it pre 1991 when ADAMS/View didn't exist.
There have been some reasons to not use the dialog box in the beginning. But yes, you are right, I now do get that it would have been smarter. For now I need some results and therefore I'll keep working with the python code.
(I thought HEEDS is building the model/ cmd-file in each optimization step...)
I am aware of the problem, that adjusting 10000 lines of code is not the solution, that's why I was hoping someone had an idea of how to use "make flexible" automatically at the end of building the model. That is beacause the people who'll use this in the end don't know much about adams and it would take to much time to make them completly familiar with everything. If I won't find another way I'll have to do it that way, but I'd like to avoid that.
So I can't actually post lines of code, as I first have to have a proper idea. I'll keep yours in mind, of course.