| Author |
Message |
srinivasan
Guest
|
Posted:
Thu Mar 24, 2005 2:45 pm Post subject:
Axdbdocument and Acaddocument |
|
|
Hello all
I had created a dbxdocument using objectdbx.
Now i am getting a reference to the drawing i need.
Can set the reference to an acaddocument.
Dim doc As AcadDocument
Dim objdbxdoc As Object
Dim mdrawing As String
mdrawing = "d:\sample.dwg"
Set objdbxdoc = GetInterfaceObject("ObjectDBX.AxDbDocument")
objdbxdoc.Open mdrawing
set doc=objdbxdoc
Its giving me error,when i set the reference to an acaddoc.
Thanks in advance
Sri
|
|
| Back to top |
|
 |
Norman Yuan
Guest
|
Posted:
Thu Mar 24, 2005 7:12 pm Post subject:
Re: Axdbdocument and Acaddocument |
|
|
AxdbDocument IS NOT AcadDocument, hence the error. Why do you need a
AcadDocument here when using ObjectDBX? Yuo have gotten a "document" object
(objdbxdoc), just do what you want with it similar to with AcadDocument.
"srinivasan" <nospam@address.withheld> wrote in message
news:23468360.1111657585188.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | Hello all
I had created a dbxdocument using objectdbx.
Now i am getting a reference to the drawing i need.
Can set the reference to an acaddocument.
Dim doc As AcadDocument
Dim objdbxdoc As Object
Dim mdrawing As String
mdrawing = "d:\sample.dwg"
Set objdbxdoc = GetInterfaceObject("ObjectDBX.AxDbDocument")
objdbxdoc.Open mdrawing
set doc=objdbxdoc
Its giving me error,when i set the reference to an acaddoc.
Thanks in advance
Sri |
|
|
| Back to top |
|
 |
srinivasan
Guest
|
Posted:
Fri Mar 25, 2005 9:39 am Post subject:
Re: Axdbdocument and Acaddocument |
|
|
Thanks Yuan
Actually i need both case.I have functions to check
existing layers,linetypes etc which accepts the document
object and the names as input.
when i pass the objdbxdoc it is not considering it as an
document object.
With kind regards
Regards
Sri
|
|
| Back to top |
|
 |
Lanny
Guest
|
Posted:
Sat Mar 26, 2005 1:20 am Post subject:
Re: Axdbdocument and Acaddocument |
|
|
| You could declare your document object as Object -- then you could use it as an acad document or as a dbx document... i do that here without much difficulty. You do have to watch that you only use functions & objects shared by both... HTH - Lanny |
|
| Back to top |
|
 |
Frank Oquendo
Guest
|
Posted:
Sat Mar 26, 2005 1:32 am Post subject:
Re: Axdbdocument and Acaddocument |
|
|
srinivasan wrote:
| Quote: | Its giving me error,when i set the reference to an acaddoc.
|
AxDbDocument <> AcadDocument.
The two are used in totally different contexts. If you need to open an
AxDbDocument do so by using the Documents collection of the
AcadApplication class. That will return an AcadDocument reference.
Which begs the question: If you're going to open it any way, why not
just do so from the start? |
|
| Back to top |
|
 |
Tony Tanzillo
Guest
|
Posted:
Sat Mar 26, 2005 10:02 am Post subject:
Re: Axdbdocument and Acaddocument |
|
|
AcadDocument and AxDbDocument are not compatible
interfaces.
You cannot write code that manipulates either
of them.
What you should do, is write your code to work with
an AcadDatabase, because both AcadDocument and
AxDbDocument both have a Database property of
the type AcadDatabase:
Public Function DoStuff(Database As AcadDatabase)
'...
End Function
Then, you can call DoStuff and pass it the value of
the Database property of either an AcadDocument or
an AxDbDocument.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005
http://www.acadxtabs.com
"srinivasan" <nospam@address.withheld> wrote in message
news:19340288.1111725598852.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | Thanks Yuan
Actually i need both case.I have functions to check
existing layers,linetypes etc which accepts the document
object and the names as input.
when i pass the objdbxdoc it is not considering it as an
document object.
With kind regards
Regards
Sri |
|
|
| Back to top |
|
 |
srinivasan
Guest
|
Posted:
Sat Mar 26, 2005 10:02 am Post subject:
Re: Axdbdocument and Acaddocument |
|
|
thanks all for your valuable suggestions.
Regards
Sri |
|
| Back to top |
|
 |
|
|
|
|