Thanks @kaosat-dev Kaosat-dev but it's not really what i'm trying to do. I have a first file that contains parameters for screws to make holes easily in printed parts you have countersunk head, hexagonal head, cylindrical head etc... and for each you have different diameters of scew. For each new files that i creates who use this include file i've to make a section of choice in getParameterDefinitions . Is it posible to do something to retrieve those parameters directly in the first file. an exemple of what i'm trying to do:
drilling.jscad
[code]
listdrill = function listdrill(type){
var toreturn = [];
if (type == ' countersunk'){
toreturn=[
[1.6,3.73,1],
[2,4.78,1.1],
[3,6.82,1.4],
...
];
if( type =='hexagonal'){
toreturn = [......
];
}
return toreturn;
}
[/code]
and in the other file :
[code]
include("..path/to/drilling.jscad");
function getParameterDefinitions{
var listdrill = listdrill(type);
var foruser='{name:'drillDiameter', initial: '3', type:'choice', caption: 'diameter', values: [';
for(i=0;i<listdrill.length;i++){
foruser= foruser+'''+listdrill[i][0]+'',';}
...
return[
foruser,
];
}
[/code]
This is an exemple of what i'm trying to do. Hope it's a little bit clearer. it partialy work in the main part of a program but not in the getParameterDefinitions. Sorry i haven't found the way to put the code in black. Sorry for my pour english, i'm a french guy. Do you think it's possible? I've tryed with require that you have mentioned but jscad answer me ReferenceError: require is not defined. Thanks for reading hopes that a solution exist. Best regards