arimans
Guest
Hello everyone,
Since I am always asking, this time I write something I discovered and that can be very useful, connect a excel sheet with a model *.prt.
in order to do so, you must have the aax form.
1) prepare the model (e.g. a cylinder) rename the size you need, e.g. the size d1 in "height_cylinder"
2) Enter the parameters:
- height type number, value per e.g. 100
-regen_input type yes/no, value no
3) in the reports write:
"height_cylinder=height"
4) choose tool-->program-->edita program. in the text file between "input" and "end input" insert:
"if regen_input = yes
height number
end if
here will be declared the parameters we want to be able to connect to the excel sheet, in this case the parameter "height".
5) in the config.pro must be added the mapkey:
map The ya ~ command `procmdmmparams` ;\
mapkey(continued) ~ columnselect `relation_dlg` `paramsphlay.partable`1 `name`;\
mapkey(continued) ~ arm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ disarm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ arm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ disarm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ open `relation_dlg` `paramsphlay.partable_input`;\
mapkey(continued) ~ close `relation_dlg` `paramsphlay.partable_input`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable_input`1 `yes`;\
mapkey(continued) ~ move `relation_dlg` `relation_dlg`2 29.984987 6.492077 ;\
mapkey(continued) ~ activate `relation_dlg` `pb_ok`;~ command `procmdregenpart` ;#read file;\
mapkey(continued) c:\temp\data.txt;~ command `procmdmmparams` ;\
mapkey(continued) ~ columnselect `relation_dlg` `paramsphlay.partable`1 `name`;\
mapkey(continued) ~ arm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ disarm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ arm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ disarm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ open `relation_dlg` `paramsphlay.partable_input`;\
mapkey(continued) ~ close `relation_dlg` `paramsphlay.partable_input`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable_input`1 `no`;\
mapkey(continued) ~ move `relation_dlg` `relation_dlg`2 29.984987 6.492077 ;\
mapkey(continued) ~ activate `relation_dlg` `pb_ok`;~ command `procmdregenpart` ;
dove yyy é il nome della mapkey e c:\temp\data.txt é il file che verrá letto con i valori dei parametri.
se non userete la macro qui sotto, il file *.txt deve essere formattato cosí:
altezza = 500
6) potete quindi prendere un foglio excel inserire i valori come volete, l´importante é che in una pagina, per es. in "esporta", i dati siano formattati nella seguente maniera:
------colonna a---colonna b---colonna c
riga1-" altezza "------" = "-------" 500 "
7) inserire poi la seguente macro:
option explicit
public nametxt as string
sub export_txt()
dim x, y as integer
dim str, folder, name as string
x = 1
y = 1
sheets("porta").select
fold = "c:\ proe\"
name = "data.txt"
nametxt = folder & name
open nametxt for output as #1
do until cells(y, x).value = "
str = cells(y, x).value
for x = 2 to 3
str = str & " & cells(y, x).value
next
print #1, str
y = y + 1
== sync, corrected by elderman ==
♪
loop
♪
end
where of course folder and name can be to please, the important thing is that the name of the folder ends with "\".
8) at this point just connect the mapkey with a button.
When the data is changed on the excel sheet simply turn the macro and then mapkey and the game is done
I hope I was useful.
Hi.
france
Since I am always asking, this time I write something I discovered and that can be very useful, connect a excel sheet with a model *.prt.
in order to do so, you must have the aax form.
1) prepare the model (e.g. a cylinder) rename the size you need, e.g. the size d1 in "height_cylinder"
2) Enter the parameters:
- height type number, value per e.g. 100
-regen_input type yes/no, value no
3) in the reports write:
"height_cylinder=height"
4) choose tool-->program-->edita program. in the text file between "input" and "end input" insert:
"if regen_input = yes
height number
end if
here will be declared the parameters we want to be able to connect to the excel sheet, in this case the parameter "height".
5) in the config.pro must be added the mapkey:
map The ya ~ command `procmdmmparams` ;\
mapkey(continued) ~ columnselect `relation_dlg` `paramsphlay.partable`1 `name`;\
mapkey(continued) ~ arm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ disarm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ arm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ disarm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ open `relation_dlg` `paramsphlay.partable_input`;\
mapkey(continued) ~ close `relation_dlg` `paramsphlay.partable_input`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable_input`1 `yes`;\
mapkey(continued) ~ move `relation_dlg` `relation_dlg`2 29.984987 6.492077 ;\
mapkey(continued) ~ activate `relation_dlg` `pb_ok`;~ command `procmdregenpart` ;#read file;\
mapkey(continued) c:\temp\data.txt;~ command `procmdmmparams` ;\
mapkey(continued) ~ columnselect `relation_dlg` `paramsphlay.partable`1 `name`;\
mapkey(continued) ~ arm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ disarm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `name`;\
mapkey(continued) ~ arm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ disarm `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable`2 `rowregen_input` `value`;\
mapkey(continued) ~ open `relation_dlg` `paramsphlay.partable_input`;\
mapkey(continued) ~ close `relation_dlg` `paramsphlay.partable_input`;\
mapkey(continued) ~ select `relation_dlg` `paramsphlay.partable_input`1 `no`;\
mapkey(continued) ~ move `relation_dlg` `relation_dlg`2 29.984987 6.492077 ;\
mapkey(continued) ~ activate `relation_dlg` `pb_ok`;~ command `procmdregenpart` ;
dove yyy é il nome della mapkey e c:\temp\data.txt é il file che verrá letto con i valori dei parametri.
se non userete la macro qui sotto, il file *.txt deve essere formattato cosí:
altezza = 500
6) potete quindi prendere un foglio excel inserire i valori come volete, l´importante é che in una pagina, per es. in "esporta", i dati siano formattati nella seguente maniera:
------colonna a---colonna b---colonna c
riga1-" altezza "------" = "-------" 500 "
7) inserire poi la seguente macro:
option explicit
public nametxt as string
sub export_txt()
dim x, y as integer
dim str, folder, name as string
x = 1
y = 1
sheets("porta").select
fold = "c:\ proe\"
name = "data.txt"
nametxt = folder & name
open nametxt for output as #1
do until cells(y, x).value = "
str = cells(y, x).value
for x = 2 to 3
str = str & " & cells(y, x).value
next
print #1, str
y = y + 1
== sync, corrected by elderman ==
♪
loop
♪
end
where of course folder and name can be to please, the important thing is that the name of the folder ends with "\".
8) at this point just connect the mapkey with a button.
When the data is changed on the excel sheet simply turn the macro and then mapkey and the game is done
I hope I was useful.
Hi.
france