Re: Re: How to connect one object to the other?

*To*: mathgroup at smc.vnet.net*Subject*: [mg88977] Re: [mg88927] Re: How to connect one object to the other?*From*: "Gohar Sultan" <contact2gohar at gmail.com>*Date*: Thu, 22 May 2008 06:16:48 -0400 (EDT)*References*: <200805201053.GAA05101@smc.vnet.net>

Guys, thanks for useful suggestions, but i want something like, attached image (find the attached jpg image file - contact the author as attachments are not permitted in this group - moderator). i want to connect one object (disk / circle) to the other, with arrow, and when we move any object, all attached arrows has to attached with it. On Wed, May 21, 2008 at 11:52 PM, Syd Geraghty <sydgeraghty at mac.com> wrote: > Gohar, > > Below are two solutions with different characteristics:- > > First, > > plotObject[G_] := > Locator[{RandomReal[30], RandomReal[30]}, Graphics[G], ImageSize -> > 20] > > > Framed@Graphics[ > Table[{Arrow[{{RandomReal[30], RandomReal[30]}, {RandomReal[30], > RandomReal[30]}}], > plotObject[{RGBColor[RandomReal[1], RandomReal[1], RandomReal[1], > 0.5], > Disk[{5, 5}, 5]}]}, {i, 10}], PlotRange -> 50] > > gives black arrows which can be double clicked to move, resize & > redirect each of them but are not Locators. > > Second, > > plotObject[G_] := > Locator[{RandomReal[30], RandomReal[30]}, Graphics[G], ImageSize -> > 40] > > Framed@Graphics[ > Table[{plotObject[{RGBColor[RandomReal[1], RandomReal[1], > RandomReal[1], > 0.5], Arrowheads[Large], > Arrow[{{RandomReal[30], RandomReal[30]}, {RandomReal[30], > RandomReal[30]}}]}], > plotObject[{RGBColor[RandomReal[1], RandomReal[1], RandomReal[1], > 0.9], > Disk[{5, 5}, 5]}]}, {i, 10}], PlotRange -> 50] > > gives random coloured arrows which are locators which can be dragged > but which cannot be resized or redirected. > > HTH, > > Cheers ... Syd > > Syd Geraghty B.Sc, M.Sc. > > sydgeraghty at mac.com > > My System > > Mathematica 6.0.2.1 for Mac OS X x86 (64 - bit) (March 13, 2008) > MacOS X V 10.5.2 > MacBook Pro 2.33 Ghz Intel Core 2 Duo 2GB RAM > > > > > > > On May 20, 2008, at 3:53 AM, Gohar Sultan wrote: > > > i am using Mathematica 6 on Window XP > > > > this code makes disk drag able disk objects, i want to connect them > > with > > arrow, how con i achieve this, any ideas? > > > > plotObject[G_] := Locator[{RandomReal[30], RandomReal[30]}, > > Graphics[G], ImageSize -> 20] > > > > p = { > > RGBColor[RandomReal[1], RandomReal[1], RandomReal[1], 0.5], > > Disk[{5, 5}, 5] > > } > > > > Framed@Graphics[ > > Table[plotObject[{RGBColor[RandomReal[1], RandomReal[1], > > RandomReal[1], 0.5], Disk[{5, 5}, 5]}], {i, 10}], > > PlotRange -> 50] > > > > > > > > > > Thanks in advance, > > Gohar Sultan > > > > > > >

**References**:**How to connect one object to the other?***From:*"Gohar Sultan" <contact2gohar@gmail.com>