How to add a CADImageEnt?

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
macservice123
Posts: 1
Joined: 15 Jun 2019, 07:22

How to add a CADImageEnt?

Post by macservice123 » 15 Jun 2019, 07:28

How to Add a CADImageEnt? Not use EntitiesCreator.
There is no code in AddEntityDemo.
who know?
Thanks!
Cristiano

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: How to add a CADImageEnt?

Post by support » 17 Jun 2019, 16:58

Hello,

AddEntities demo project contains the following code which shows how to add a CADImageEnt object.

Code: Select all

        private void AddImageEnt()
        {
            string fileName = cnstImagePath;
            if (!File.Exists(fileName))
            {
                fileName = cnstAddonPath + fileName;
                if (!File.Exists(fileName))
                    return;
            }
            CADImageDef vImageDef = new CADImageDef();
            vImageDef.FileName = fileName;
            if (new Bitmap(vImageDef.FileName) != null)
            {
                AddEntToSection(ConvSection.ImageDefs, vImageDef);
                CADImageEnt vImageEnt = new CADImageEnt();
                vImageEnt.ImageDef = vImageDef;
                vImageEnt.Point = new DPoint(180, 100, 0);
                vImageEnt.UVector = CADConst.XOrtAxis;
                vImageEnt.VVector = CADConst.YOrtAxis;
                vImageEnt.Size = vImageEnt.ImageDef.Size;
                vImageEnt.Width = 59;
                if (!PlaceEntity(vImageEnt))
                    this.cadImage.Converter.ImageDefs.Remove(vImageDef);
            }
        }
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply