Problem with ports of shapes inserted from LibraryBrowser


Author
Message
Hans Henrik Friis Pedersen...
Hans Henrik Friis Pedersen
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 28, Visits: 136
Hi,

I'm using the attached class to make a shape.

When directly inserted the ports are present and everything works fine.

However, If I use the following code to insert the shape into a library and then try to insert the shape into a nDrawingDocument using "drag and drop", the ports are no longer present? What have I done wrong? 


        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            CondensorShape Kondensator = CreateCondensor(new NPointF(120, 20), 1.0f, 0.0f);
            nDrawingDocument1.ActiveLayer.AddChild(Kondensator);

            // create a new library
            NLibraryDocument library = new NLibraryDocument();
            library.Info.Title = "My first library";


             library.AddChild(new NMaster(Kondensator, NGraphicsUnit.Pixel, "Kondensator", "My Kondensator"));

            nLibraryBrowser1.OpenLibraryGroup(library);

        }

        protected CondensorShape CreateCondensor(NPointF location, float scale, float rotation)
        {
            CondensorShape Condensor = new CondensorShape();
            NStyle.SetFillStyle(Condensor, new NColorFillStyle(Color.Empty));

            Condensor.Location = location;
            Condensor.Width = Condensor.Width * scale;
            Condensor.Height = Condensor.Height * scale;
            Condensor.Rotate(CoordinateSystem.Scene, rotation, Condensor.Location);

            return Condensor;
        }


Attachments
CondensorShape.txt (621 views, 3.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search