.NET

.NET

Reply
Active Contributor LE3
Active Contributor
LE3
Posts: 30
Registered: ‎06-07-2004
Message 11 of 12 (82 Views)

Re: VB.net syntax for adding image without frame

05-27-2014 02:05 PM in reply to: conormccartney3897

I just happen to be working on a method that requires this, and it is based on the code here: http://adndevblog.typepad.com/autocad/2012/05/access-raster-image-variables-using-the-net-api.html (VB.NET)

 

Or in the case it is useful, the counter part in C#, that works for me here:

 

var nodDictionary = transaction.GetObject(database.NamedObjectsDictionaryId, OpenMode.ForRead) as DBDictionary;

if (nodDictionary != null)

{

conststring acadImageVars = "ACAD_IMAGE_VARS";

RasterVariables rasterVariables;

if (nodDictionary.Contains(acadImageVars))

{

var acadImageVarsId = nodDictionary.GetAt(acadImageVars);

rasterVariables = transaction.GetObject(acadImageVarsId, OpenMode.ForWrite) as RasterVariables;

}

else

{

rasterVariables = new RasterVariables();

nodDictionary.UpgradeOpen();

nodDictionary.SetAt(acadImageVars, rasterVariables);

transaction.AddNewlyCreatedDBObject(rasterVariables, true);

}

if (rasterVariables != null)

{

rasterVariables.ImageFrame = FrameSetting.ImageFrameOff;

}

}

 

HTH.

Contributor
BugWare
Posts: 13
Registered: ‎04-17-2012
Message 12 of 12 (60 Views)

Re: VB.net syntax for adding image without frame

05-28-2014 10:28 AM in reply to: _gile

But it IS already equal to 0 when the program starts, so checking to see if it's 0 won't help.  It must be changed to 1, then set back to 0 to get it to work. I've tested this several times.

Micropaleontology
Oil Industry
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.