コード例 #1
0
 event_EndEntity(object sender, Autodesk.AutoCAD.Publishing.PublishEntityEventArgs e)
 {
     PrintReactorMessage("End Entity");
     if (m_showDetails)
     {
         Snoop.Forms.Objects dbox = new Snoop.Forms.Objects(e);
         dbox.Text = "EndEntity";
         dbox.ShowDialog();
     }
 }
コード例 #2
0
        PublishEntityProperties(Autodesk.AutoCAD.Publishing.PublishEntityEventArgs e)
        {
            Int32 curNodeId = -1;

            AcDb.ObjectIdCollection refPathIds;

            refPathIds = e.getEntityBlockRefPath();
            curNodeId  = e.GetEntityNode(e.Entity.ObjectId, refPathIds);

            AcPb.EPlotPropertyBag propBag = new AcPb.EPlotPropertyBag();
            AcPb.EPlotProperty    prop;
            AcPb.EPlotAttribute   attrib;

            //Add the property
            //
            prop          = new AcPb.EPlotProperty();
            prop.Name     = "Cast Shadows";
            prop.Category = "Entity Properties";
            prop.Value    = e.Entity.CastShadows.ToString();

            //Add the hidden attribute data to the property
            //
            attrib       = new AcPb.EPlotAttribute();
            attrib.Ns    = "MgdDbg";
            attrib.NsUrl = "http://adsk/MgdDbg.xsd";
            attrib.Name  = "value";
            attrib.Value = System.Convert.ToInt32(e.Entity.CastShadows).ToString();

            prop.Attributes.Add(attrib);
            propBag.Properties.Add(prop);

            //Add the property
            //
            prop          = new AcPb.EPlotProperty();
            prop.Name     = "Clone Me For Dragging";
            prop.Category = "Entity Properties";
            prop.Value    = e.Entity.CloneMeForDragging.ToString();

            //Add the hidden attribute data to the property
            //
            attrib       = new AcPb.EPlotAttribute();
            attrib.Ns    = "MgdDbg";
            attrib.NsUrl = "http://adsk/MgdDbg.xsd";
            attrib.Name  = "value";
            attrib.Value = System.Convert.ToInt32(e.Entity.CloneMeForDragging).ToString();

            prop.Attributes.Add(attrib);
            propBag.Properties.Add(prop);

            //Add the property
            //
            prop          = new AcPb.EPlotProperty();
            prop.Name     = "Collision Type";
            prop.Category = "Entity Properties";
            prop.Value    = e.Entity.CollisionType.ToString();

            //Add the hidden attribute data to the property
            //
            attrib       = new AcPb.EPlotAttribute();
            attrib.Ns    = "MgdDbg";
            attrib.NsUrl = "http://adsk/MgdDbg.xsd";
            attrib.Name  = "value";
            attrib.Value = System.Convert.ToInt32(e.Entity.CollisionType).ToString();

            prop.Attributes.Add(attrib);
            propBag.Properties.Add(prop);

            //Add the property
            //
            prop          = new AcPb.EPlotProperty();
            prop.Name     = "Color";
            prop.Category = "Entity Properties";
            prop.Value    = e.Entity.Color.ColorNameForDisplay;

            //Add the hidden attribute data to the property
            //
            attrib       = new AcPb.EPlotAttribute();
            attrib.Ns    = "MgdDbg";
            attrib.NsUrl = "http://adsk/MgdDbg.xsd";
            attrib.Name  = "value";
            attrib.Value = e.Entity.ColorIndex.ToString();

            prop.Attributes.Add(attrib);
            propBag.Properties.Add(prop);

            //Now that all the properties have been setup, associate them with the node
            //
            AcPb.DwfNode dwfNode = null;

            if (curNodeId == -1)
            {
                curNodeId = e.GetNextAvailableNode();
                dwfNode   = new AcPb.DwfNode(curNodeId, "MgdDbg");

                e.AddNodeToMap(e.Entity.ObjectId, refPathIds, curNodeId);
            }
            else
            {
                dwfNode = e.GetNode(curNodeId);
            }

            propBag.Id = "MGDDBG-" + e.UniqueEntityId;
            propBag.References.Add(propBag.Id);

            e.AddPropertyBag(propBag);
            e.AddPropertiesIds(propBag, dwfNode);
        }