2
$\begingroup$

I'm trying to create a dynamic interface to generate disks depending on 3 parameters : x-coordinate, y-coordinate and radius. The disks are generated as soon as the "export" button is pressed. I'm trying to make a table of disks but I can't link the dynamic objects and the creation of disks. Any idea?

Manipulate[Manipulate[Column[{{points = Eingabefeld4}}], Style["Armierung", 12, Bold],{{Eingabefeld4, ArrayReshape[{}, {Eisen, 3}]}, Labeled[Grid[
  Table[With[{i = i, j = j, phi = phi}, 
    InputField[Dynamic[Eingabefeld4[[i, j]]], 
     ImageSize -> Tiny]], {i, Eisen}, {j, 3}]], 
 " X                     Y                    phi", Top] &},Button["Export", {export = Table[Disk[{i, j}, phi], 1, Eisen]}]],Control@{{Eisen, 1}, InputField[]}]

The number of disks depends on "Eisen."

Example with 3 disks

$\endgroup$
2
  • $\begingroup$ do you get what you need if you change Button[...] to Button["Export", export = (Disk[{#, #2}, #3] & @@@ points)] ? $\endgroup$ – kglr Mar 9 '20 at 22:34
  • $\begingroup$ Exactly what I wanted Big thanks! $\endgroup$ – Jocelyn Minini Mar 10 '20 at 8:24
3
$\begingroup$
Manipulate[Take[Eingabefeld4, Eisen], 
 {{Eisen, 1}, InputField[]},
 Dynamic@Panel[Column[{Style["Armierung", 12, Bold], 
     Labeled[Grid[Table[With[{i = i, j = j},
             InputField[Dynamic[Eingabefeld4[[i, j]]], ImageSize -> Tiny]],
                {i, Eisen}, {j, 3}]],
       {Row[{"   X", "Y", "phi"}, Spacer[70]], "Eingabefeld4"}, {Top, Left}], 
     Button["Export", export = Disk[{#, #2}, #3] & @@@ Take[Eingabefeld4, Eisen]]}]], 
 Initialization :> {Eingabefeld4 = ConstantArray[0, {50, 3}]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.