https://forums.autodesk.com/t5/net/how-to-inse ... to-an-ole2frame/td-p/3204776It is not possible for applications to create an ole object (AcDbOle2Frame/Ole2Frame object) in AutoCAD.
This is explained in the ObjectARX help file in the description for “setOleObject” method and I quote :
“The COleClientItem class used by AutoCAD is a modified version of the class that ships from Microsoft. This means that it is not possible for applications to create their own COleClientItem objects for use by this function. This function can only be used with COleClientItem objects created by AutoCAD (that is, the object from another AcDbOle2Frame object).“
For this reason, the workaround could be to use a drawing file that contains the image as a template and using it in an insert operation.
应用程序无法在AutoCAD中创建ole对象(AcDbOle2Frame/Ole2Frame对象)。
这在“setOleObject”方法的描述中的ObjectARX帮助文件中进行了解释,我引用了:
“AutoCAD使用的coleclientem类是Microsoft提供的类的修改版本。这意味着应用程序不可能创建自己的coleclientem对象供此函数使用。此函数只能用于由AutoCAD创建的coleclientem对象(即来自另一个AcDbOle2Frame对象的对象)
因此,解决方法可以是使用包含图像的图形文件作为模板,并在插入操作中使用它。