style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<cbertschy> wrote in messageI
href="news:6061357@discussion.autodesk.com">news:6061357@discussion.autodesk.com...
currently have code working that will grab an image stored on a local drive,
create the rasterimagedef dictionary entry, create the raster image object,
and display the image in autocad. The program works but there is no reactor
link to the image and this is apparent as the xref/image manager shows that
the added image entry has no references in the drawing. The drawing does have
the image working... but clearly something is not linked correctly. I would
normally post my code but I amaffraid it will be a garbled mess like the
garbage I have been wading through to find something helpful since the forum
update.
My code is very similar in structure to the attached link I
found which has the same issue as my code is having. In fact, everything I
have found online appears to have this same problem.
class=jive-link-external
href="http://www.objectarx.net/bbs/viewthread.php?tid=2500&extra=page...
I have been trying to fix this by implimenting the
rasterimage.AssociateRasterDef and stuffing the parameter with the new
rasterimagedef() entry (both before and after the dictionary entry and
transaction) with no luck. The mgd help is very vague on this and mentions
that a RasterImageDefReactor must be constructed. I am still learning the C#
api and language, with no background in c++ arx. A small example of using the
AssociateRasterDef correctly would be very helpful.
Thanks,
Chris
Bertschy
Side note: I typically post with OE, but I used the RTF web
format for this one. It appears that the only way to get a readable post is to
use the web rtf box. Are the users of newsgroup readers being
punished??
public
class{
{
}
//the original rid object into the method this not
work so I attempted to get update object after the image dictionary
update. Not that this should mattre but I can't
//get it to work upgrade open was something
ignorant that I also tried. I had the ri.imagedfid = rid.objectid
commented out but still did not work. all the
//example on the web show only this method being
used to link the raster image to the dictionary definition. this does not
work correctly. It does work to make the added image
//use the imagedefinition but does not add the
neccesary reactor info to recognize that the imagedef has references in the
drawing
newimagedef.
color=#191970>UpgradeOpen
size=1>();
ri.ImageDefId
color=#006400>= rid.ObjectId
color=#006400>;
ri.
color=#191970>AssociateRasterDef
color=#006400>(newimagedef
size=1>);
ri.Visible
color=#006400>= true
color=#006400>;
ri.Orientation
color=#006400>= new
color=#191970>CoordinateSystem3d
color=#006400>( p1, new
Vector3d
color=#006400>(width,
color=#00008b>0,
color=#00008b>0), new
Vector3d
color=#006400>(0
color=#006400>,height,
color=#00008b>0));
btr.
color=#191970>AppendEntity
color=#006400>(ri);
tr.
color=#191970>AddNewlyCreatedDBObject
color=#006400>(ri,
color=#008b8b>true);
color=#008000>
tr.
color=#191970>Commit();
color=#008000>
}
doclock.
color=#191970>Dispose
size=1>();
}
}
}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Tony Tanzillo" <
href="mailto:tony.tanzillo@THE_URL_BELOW.com">tony.tanzillo@THE_URL_BELOW.com>
wrote in message
href="news:6061475@discussion.autodesk.com">news:6061475@discussion.autodesk.com...
Your code isn't calling RasterImage.AssociateImageDef(),
which is
what creates the reactor and adds it to
the RasterImageDef.
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009
href="http://www.acadxtabs.com">http://www.acadxtabs.com
Introducing AcadXTabs 2010:
href="http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm">http://www.caddzone.com/acadxtabs/Acad...
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<cbertschy> wrote in messageI
href="news:6061357@discussion.autodesk.com">news:6061357@discussion.autodesk.com...
currently have code working that will grab an image stored on a local drive,
create the rasterimagedef dictionary entry, create the raster image object,
and display the image in autocad. The program works but there is no reactor
link to the image and this is apparent as the xref/image manager shows that
the added image entry has no references in the drawing. The drawing does
have the image working... but clearly something is not linked correctly. I
would normally post my code but I amaffraid it will be a garbled mess like
the garbage I have been wading through to find something helpful since the
forum update.
My code is very similar in structure to the attached
link I found which has the same issue as my code is having. In fact,
everything I have found online appears to have this same problem.
class=jive-link-external
href="http://www.objectarx.net/bbs/viewthread.php?tid=2500&extra=...
I have been trying to fix this by
implimenting the rasterimage.AssociateRasterDef and stuffing the parameter
with the new rasterimagedef() entry (both before and after the dictionary
entry and transaction) with no luck. The mgd help is very vague on this and
mentions that a RasterImageDefReactor must be constructed. I am still
learning the C# api and language, with no background in c++ arx. A small
example of using the AssociateRasterDef correctly would be very helpful.
Thanks,
Chris Bertschy
Side note: I typically post with
OE, but I used the RTF web format for this one. It appears that the only way
to get a readable post is to use the web rtf box. Are the users of newsgroup
readers being punished??
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"CB" <
href="mailto:spamfilter@satx.rr.com">spamfilter@satx.rr.com> wrote in
message
href="news:6061565@discussion.autodesk.com">news:6061565@discussion.autodesk.com...
That is correct. When I code something
like:
ri.associaterasterdef(rid);
I get an error in autocad that tells me the entry
does not exist in the database.
I am guessing that it is looking for a reactor id
that does not exist or that the raster image def is not being handle
properly. My question is really where in the code would I put the call
to ri.associaterasterdef(rasterimagedef). I found a small tid bit that
mentioned setting up a reactionid but nothing on how to handle this.
Attached is my version. It is a work in progress. I am posting via
OE so I have no idea how this will look.
Thanks, Tony.
public
class
size=1>ACADutility {
public
size=1>static void
color=#191970 size=1>addimage
size=1>(double
size=1>height,
size=1>double width,
Point3d p1,
size=1>Point3d p2){
Document doc =
Application.
size=1>DocumentManager.
size=1>MdiActiveDocument;
Database db =
doc.
size=1>Database;
Editor ed =
doc.
size=1>Editor;
Transaction tr =
db.
size=1>TransactionManager.
color=#191970 size=1>StartTransaction
size=1>();
DocumentLock doclock
size=1>= doc
size=1>.LockDocument
color=#006400 size=1>();
using
size=1>(tr)
{
BlockTable bt =
(BlockTable)
size=1>tr.
size=1>GetObject(
size=1>db.
size=1>BlockTableId,
size=1>OpenMode.
size=1>ForRead);
BlockTableRecord btr
size=1>= new
size=1>BlockTableRecord();
btr = (
size=1>BlockTableRecord)
size=1>tr.
size=1>GetObject(
size=1>bt[
size=1>BlockTableRecord.
size=1>ModelSpace],
size=1>OpenMode.
size=1>ForWrite);
RasterImageDef rid =
new
size=1>RasterImageDef();
ObjectId ImgDictID =
RasterImageDef
size=1>.
size=1>GetImageDictionary(
size=1>db);
if
size=1>(ImgDictID
size=1>.IsNull)
{
ImgDictID =
RasterImageDef
size=1>.
size=1>CreateImageDictionary
size=1>(db);
}
rid.
size=1>SourceFileName =
color=#0000ff size=1>"c:\\temp\\gis-image-test.jpg"
size=1>;
rid.
size=1>ResolutionUnits =
size=1>Unit.
size=1>Foot;
rid.
color=#191970 size=1>Load();
rid.
color=#191970 size=1>OpenImage();
rid.
color=#191970 size=1>UpdateEntities
size=1>();
DBDictionary imgdict
size=1>=(DBDictionary
size=1>)tr
size=1>.GetObject
color=#006400 size=1>(ImgDictID
size=1>, OpenMode
size=1>.ForWrite);
ObjectId rasterimdefid
size=1>;
rasterimdefid =
imgdict.
color=#191970 size=1>SetAt(
color=#0000ff size=1>"image-SERVICE",
rid);
tr.
color=#191970 size=1>AddNewlyCreatedDBObject
size=1>(rid,
true
size=1>);
RasterImage ri =
new
size=1>RasterImage();
color=#008000 size=1>
RasterImageDef newimagedef
size=1>= (RasterImageDef
size=1>)tr
size=1>.GetObject
color=#006400 size=1>(rid
size=1>.ObjectId,
OpenMode.
size=1>ForWrite);// this was my last ditch
effort to get a raster image def to work. stuffing
//the original rid object into the method this
not work so I attempted to get update object after the image dictionary
update. Not that this should mattre but I can't
//get it to work upgrade open was
something ignorant that I also tried. I had the ri.imagedfid =
rid.objectid commented out but still did not work. all the
//example on the web show only this method being
used to link the raster image to the dictionary definition. this does
not work correctly. It does work to make the added image
//use the imagedefinition but does not add the
neccesary reactor info to recognize that the imagedef has references in the
drawing
newimagedef.
color=#191970>UpgradeOpen
size=1>();
ri.ImageDefId
color=#006400>= rid.ObjectId
color=#006400>;
ri.
color=#191970>AssociateRasterDef
color=#006400>(newimagedef
size=1>);
ri.Visible
color=#006400>= true
color=#006400>;
ri.Orientation
color=#006400>= new
color=#191970>CoordinateSystem3d
color=#006400>( p1,
color=#008b8b>new Vector3d
size=1>(width,
color=#00008b>0,
color=#00008b>0), new
Vector3d
color=#006400>(0
color=#006400>,height,
color=#00008b>0));
btr.
color=#191970>AppendEntity
color=#006400>(ri);
tr.
color=#191970>AddNewlyCreatedDBObject
color=#006400>(ri,
color=#008b8b>true);
color=#008000>
tr.
color=#191970>Commit
size=1>();
}
doclock.
color=#191970>Dispose
size=1>();
}
}
}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Tony Tanzillo" <
href="mailto:tony.tanzillo@THE_URL_BELOW.com">tony.tanzillo@THE_URL_BELOW.com>
wrote in message
href="news:6061475@discussion.autodesk.com">news:6061475@discussion.autodesk.com...
Your code isn't calling RasterImage.AssociateImageDef(),
which is
what creates the reactor and adds it to
the RasterImageDef.
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD
2000 through 2009
href="http://www.acadxtabs.com">http://www.acadxtabs.com
Introducing AcadXTabs 2010:
href="http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm">http://www.caddzone.com/acadxtabs/Ac...
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<cbertschy> wrote in messageI
href="news:6061357@discussion.autodesk.com">news:6061357@discussion.autodesk.com...
currently have code working that will grab an image stored on a local
drive, create the rasterimagedef dictionary entry, create the raster image
object, and display the image in autocad. The program works but there is
no reactor link to the image and this is apparent as the xref/image
manager shows that the added image entry has no references in the drawing.
The drawing does have the image working... but clearly something is not
linked correctly. I would normally post my code but I amaffraid it will be
a garbled mess like the garbage I have been wading through to find
something helpful since the forum update.
My code is very similar
in structure to the attached link I found which has the same issue as my
code is having. In fact, everything I have found online appears to have
this same problem.
href="http://www.objectarx.net/bbs/viewthread.php?tid=2500&extra=page%3D1"
target=_new...
I have been trying to fix this by
implimenting the rasterimage.AssociateRasterDef and stuffing the parameter
with the new rasterimagedef() entry (both before and after the dictionary
entry and transaction) with no luck. The mgd help is very vague on this
and mentions that a RasterImageDefReactor must be constructed. I am still
learning the C# api and language, with no background in c++ arx. A small
example of using the AssociateRasterDef correctly would be very helpful.
Thanks,
Chris Bertschy
Side note: I typically post with
OE, but I used the RTF web format for this one. It appears that the only
way to get a readable post is to use the web rtf box. Are the users of
newsgroup readers being
punished??
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Tony Tanzillo" <
href="mailto:tony.tanzillo@THE_URL_BELOW.com">tony.tanzillo@THE_URL_BELOW.com>
wrote in message
href="news:6061633@discussion.autodesk.com">news:6061633@discussion.autodesk.com...
You don't pass any reactor id to
AssociateRasterDef().
You pass what the name of that method implies
(the
RasterImageDef object, which may need to be
open
and write-enabled).
That's all there is to it. You don't need to deal
with
any reactors.
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000
through 2009
href="http://www.acadxtabs.com">http://www.acadxtabs.com
Introducing AcadXTabs 2010:
href="http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm">http://www.caddzone.com/acadxtabs/Acad...
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"CB" <
href="mailto:spamfilter@satx.rr.com">spamfilter@satx.rr.com> wrote in
message
href="news:6061565@discussion.autodesk.com">news:6061565@discussion.autodesk.com...
That is correct. When I code something
like:
ri.associaterasterdef(rid);
I get an error in autocad that tells me the
entry does not exist in the database.
I am guessing that it is looking for a reactor
id that does not exist or that the raster image def is not being handle
properly. My question is really where in the code would I put the call
to ri.associaterasterdef(rasterimagedef). I found a small tid bit that
mentioned setting up a reactionid but nothing on how to handle this.
Attached is my version. It is a work in progress. I am posting
via OE so I have no idea how this will look.
Thanks, Tony.
public
class
size=1>ACADutility {
public
color=#a52a2a size=1>static void
addimage
size=1>(double
size=1>height,
color=#ff0000 size=1>double width
color=#006400 size=1>, Point3d p1
color=#006400 size=1>, Point3d p2
color=#006400 size=1>){
Document doc =
Application
size=1>.DocumentManager
size=1>.MdiActiveDocument
size=1>;
Database db =
doc.
size=1>Database;
Editor ed =
doc.
size=1>Editor;
Transaction tr =
db.
size=1>TransactionManager.
color=#191970 size=1>StartTransaction
size=1>();
DocumentLock doclock
size=1>= doc
size=1>.LockDocument
color=#006400 size=1>();
using
size=1>(tr)
{
BlockTable bt =
(BlockTable
size=1>)tr
size=1>.GetObject
color=#006400 size=1>(db
size=1>.BlockTableId,
OpenMode.
size=1>ForRead);
BlockTableRecord btr
size=1>= new
size=1>BlockTableRecord();
btr = (
size=1>BlockTableRecord)
size=1>tr.
size=1>GetObject(
size=1>bt[
size=1>BlockTableRecord.
size=1>ModelSpace],
size=1>OpenMode.
size=1>ForWrite);
RasterImageDef rid
size=1>= new
size=1>RasterImageDef();
ObjectId ImgDictID
size=1>= RasterImageDef
size=1>.
size=1>GetImageDictionary(
size=1>db);
if
size=1>(ImgDictID
size=1>.IsNull)
{
ImgDictID =
RasterImageDef
size=1>.
size=1>CreateImageDictionary
size=1>(db);
}
rid.
size=1>SourceFileName =
color=#0000ff size=1>"c:\\temp\\gis-image-test.jpg"
color=#006400 size=1>;
rid.
size=1>ResolutionUnits =
size=1>Unit.
size=1>Foot;
rid.
color=#191970 size=1>Load();
rid.
color=#191970 size=1>OpenImage();
rid.
color=#191970 size=1>UpdateEntities
size=1>();
DBDictionary imgdict
size=1>=(DBDictionary
size=1>)tr
size=1>.GetObject
color=#006400 size=1>(ImgDictID
color=#006400 size=1>, OpenMode
color=#006400 size=1>.ForWrite
size=1>);
ObjectId rasterimdefid
size=1>;
rasterimdefid =
imgdict
size=1>.SetAt
color=#006400 size=1>(
size=1>"image-SERVICE",
size=1>rid);
tr.
color=#191970 size=1>AddNewlyCreatedDBObject
size=1>(rid,
true
size=1>);
RasterImage ri =
new
size=1>RasterImage();
color=#008000 size=1>
RasterImageDef newimagedef
size=1>= (RasterImageDef
size=1>)tr
size=1>.GetObject
color=#006400 size=1>(rid
size=1>.ObjectId,
OpenMode.
size=1>ForWrite);// this was my last ditch
effort to get a raster image def to work. stuffing
//the original rid object into the method this
not work so I attempted to get update object after the image dictionary
update. Not that this should mattre but I can't
//get it to work upgrade open was
something ignorant that I also tried. I had the ri.imagedfid =
rid.objectid commented out but still did not work. all the
//example on the web show only this method
being used to link the raster image to the dictionary definition. this
does not work correctly. It does work to make the added
image
//use the imagedefinition but does not add the
neccesary reactor info to recognize that the imagedef has references in the
drawing
newimagedef.
color=#191970>UpgradeOpen
size=1>();
ri.ImageDefId
color=#006400>= rid.ObjectId
color=#006400>;
ri.
color=#191970>AssociateRasterDef
color=#006400>(newimagedef
size=1>);
ri.Visible
color=#006400>= true
color=#006400>;
ri.Orientation
color=#006400>= new
color=#191970>CoordinateSystem3d
color=#006400>( p1,
color=#008b8b>new Vector3d
size=1>(width,
color=#00008b>0,
color=#00008b>0),
color=#008b8b>new Vector3d
size=1>(0
color=#006400>,height,
color=#00008b>0));
btr.
color=#191970>AppendEntity
color=#006400>(ri
size=1>);
tr.
color=#191970>AddNewlyCreatedDBObject
color=#006400>(ri,
color=#008b8b>true
size=1>);
tr.
color=#191970>Commit
size=1>();
}
doclock.
color=#191970>Dispose
size=1>();
}
}
}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Tony Tanzillo" <
href="mailto:tony.tanzillo@THE_URL_BELOW.com">tony.tanzillo@THE_URL_BELOW.com>
wrote in message
href="news:6061475@discussion.autodesk.com">news:6061475@discussion.autodesk.com...
Your code isn't calling RasterImage.AssociateImageDef(),
which is
what creates the reactor and adds it to
the RasterImageDef.
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD
2000 through 2009
href="http://www.acadxtabs.com">http://www.acadxtabs.com
Introducing AcadXTabs 2010:
href="http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm">http://www.caddzone.com/acadxtabs/...
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<cbertschy> wrote in messageI
href="news:6061357@discussion.autodesk.com">news:6061357@discussion.autodesk.com...
currently have code working that will grab an image stored on a local
drive, create the rasterimagedef dictionary entry, create the raster
image object, and display the image in autocad. The program works but
there is no reactor link to the image and this is apparent as the
xref/image manager shows that the added image entry has no references in
the drawing. The drawing does have the image working... but clearly
something is not linked correctly. I would normally post my code but I
amaffraid it will be a garbled mess like the garbage I have been wading
through to find something helpful since the forum update.
My
code is very similar in structure to the attached link I found which has
the same issue as my code is having. In fact, everything I have found
online appears to have this same problem.
class=jive-link-external
href="http://www.objectarx.net/bbs/viewthread.php?tid=250...
I have been trying to fix this by
implimenting the rasterimage.AssociateRasterDef and stuffing the
parameter with the new rasterimagedef() entry (both before and after the
dictionary entry and transaction) with no luck. The mgd help is very
vague on this and mentions that a RasterImageDefReactor must be
constructed. I am still learning the C# api and language, with no
background in c++ arx. A small example of using the AssociateRasterDef
correctly would be very helpful.
Thanks,
Chris
Bertschy
Side note: I typically post with OE, but I used the RTF
web format for this one. It appears that the only way to get a readable
post is to use the web rtf box. Are the users of newsgroup readers being
punished??
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"CB" <
href="mailto:spamfilter@satx.rr.com">spamfilter@satx.rr.com> wrote in
message
href="news:6061565@discussion.autodesk.com">news:6061565@discussion.autodesk.com...
That is correct. When I code something
like:
ri.associaterasterdef(rid);
I get an error in autocad that tells me the entry
does not exist in the database.
I am guessing that it is looking for a reactor id
that does not exist or that the raster image def is not being handle
properly. My question is really where in the code would I put the call
to ri.associaterasterdef(rasterimagedef). I found a small tid bit that
mentioned setting up a reactionid but nothing on how to handle this.
Attached is my version. It is a work in progress. I am posting via
OE so I have no idea how this will look.
Thanks, Tony.
public
class
size=1>ACADutility {
public
size=1>static void
color=#191970 size=1>addimage
size=1>(double
size=1>height,
size=1>double width,
Point3d p1,
size=1>Point3d p2){
Document doc =
Application.
size=1>DocumentManager.
size=1>MdiActiveDocument;
Database db =
doc.
size=1>Database;
Editor ed =
doc.
size=1>Editor;
Transaction tr =
db.
size=1>TransactionManager.
color=#191970 size=1>StartTransaction
size=1>();
DocumentLock doclock
size=1>= doc
size=1>.LockDocument
color=#006400 size=1>();
using
size=1>(tr)
{
BlockTable bt =
(BlockTable)
size=1>tr.
size=1>GetObject(
size=1>db.
size=1>BlockTableId,
size=1>OpenMode.
size=1>ForRead);
BlockTableRecord btr
size=1>= new
size=1>BlockTableRecord();
btr = (
size=1>BlockTableRecord)
size=1>tr.
size=1>GetObject(
size=1>bt[
size=1>BlockTableRecord.
size=1>ModelSpace],
size=1>OpenMode.
size=1>ForWrite);
RasterImageDef rid =
new
size=1>RasterImageDef();
ObjectId ImgDictID =
RasterImageDef
size=1>.
size=1>GetImageDictionary(
size=1>db);
if
size=1>(ImgDictID
size=1>.IsNull)
{
ImgDictID =
RasterImageDef
size=1>.
size=1>CreateImageDictionary
size=1>(db);
}
rid.
size=1>SourceFileName =
color=#0000ff size=1>"c:\\temp\\gis-image-test.jpg"
size=1>;
rid.
size=1>ResolutionUnits =
size=1>Unit.
size=1>Foot;
rid.
color=#191970 size=1>Load();
rid.
color=#191970 size=1>OpenImage();
rid.
color=#191970 size=1>UpdateEntities
size=1>();
DBDictionary imgdict
size=1>=(DBDictionary
size=1>)tr
size=1>.GetObject
color=#006400 size=1>(ImgDictID
size=1>, OpenMode
size=1>.ForWrite);
ObjectId rasterimdefid
size=1>;
rasterimdefid =
imgdict.
color=#191970 size=1>SetAt(
color=#0000ff size=1>"image-SERVICE",
rid);
tr.
color=#191970 size=1>AddNewlyCreatedDBObject
size=1>(rid,
true
size=1>);
RasterImage ri =
new
size=1>RasterImage();
color=#008000 size=1>
RasterImageDef newimagedef
size=1>= (RasterImageDef
size=1>)tr
size=1>.GetObject
color=#006400 size=1>(rid
size=1>.ObjectId,
OpenMode.
size=1>ForWrite);// this was my last ditch
effort to get a raster image def to work. stuffing
//the original rid object into the method this
not work so I attempted to get update object after the image dictionary
update. Not that this should mattre but I can't
//get it to work upgrade open was
something ignorant that I also tried. I had the ri.imagedfid =
rid.objectid commented out but still did not work. all the
//example on the web show only this method being
used to link the raster image to the dictionary definition. this does
not work correctly. It does work to make the added image
//use the imagedefinition but does not add the
neccesary reactor info to recognize that the imagedef has references in the
drawing
newimagedef.
color=#191970>UpgradeOpen
size=1>();
ri.ImageDefId
color=#006400>= rid.ObjectId
color=#006400>;
ri.
color=#191970>AssociateRasterDef
color=#006400>(newimagedef
size=1>);
ri.Visible
color=#006400>= true
color=#006400>;
ri.Orientation
color=#006400>= new
color=#191970>CoordinateSystem3d
color=#006400>( p1,
color=#008b8b>new Vector3d
size=1>(width,
color=#00008b>0,
color=#00008b>0), new
Vector3d
color=#006400>(0
color=#006400>,height,
color=#00008b>0));
btr.
color=#191970>AppendEntity
color=#006400>(ri);
tr.
color=#191970>AddNewlyCreatedDBObject
color=#006400>(ri,
color=#008b8b>true);
color=#008000>
tr.
color=#191970>Commit
size=1>();
}
doclock.
color=#191970>Dispose
size=1>();
}
}
}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Tony Tanzillo" <
href="mailto:tony.tanzillo@THE_URL_BELOW.com">tony.tanzillo@THE_URL_BELOW.com>
wrote in message
href="news:6061475@discussion.autodesk.com">news:6061475@discussion.autodesk.com...
Your code isn't calling RasterImage.AssociateImageDef(),
which is
what creates the reactor and adds it to
the RasterImageDef.
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD
2000 through 2009
href="http://www.acadxtabs.com">http://www.acadxtabs.com
Introducing AcadXTabs 2010:
href="http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm">http://www.caddzone.com/acadxtabs/Ac...
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<cbertschy> wrote in messageI
href="news:6061357@discussion.autodesk.com">news:6061357@discussion.autodesk.com...
currently have code working that will grab an image stored on a local
drive, create the rasterimagedef dictionary entry, create the raster image
object, and display the image in autocad. The program works but there is
no reactor link to the image and this is apparent as the xref/image
manager shows that the added image entry has no references in the drawing.
The drawing does have the image working... but clearly something is not
linked correctly. I would normally post my code but I amaffraid it will be
a garbled mess like the garbage I have been wading through to find
something helpful since the forum update.
My code is very similar
in structure to the attached link I found which has the same issue as my
code is having. In fact, everything I have found online appears to have
this same problem.
href="http://www.objectarx.net/bbs/viewthread.php?tid=2500&extra=page%3D1"
target=_new...
I have been trying to fix this by
implimenting the rasterimage.AssociateRasterDef and stuffing the parameter
with the new rasterimagedef() entry (both before and after the dictionary
entry and transaction) with no luck. The mgd help is very vague on this
and mentions that a RasterImageDefReactor must be constructed. I am still
learning the C# api and language, with no background in c++ arx. A small
example of using the AssociateRasterDef correctly would be very helpful.
Thanks,
Chris Bertschy
Side note: I typically post with
OE, but I used the RTF web format for this one. It appears that the only
way to get a readable post is to use the web rtf box. Are the users of
newsgroup readers being
punished??