Linked data w/o handles

Linked data w/o handles

Anonymous
Not applicable
310 Views
11 Replies
Message 1 of 12

Linked data w/o handles

Anonymous
Not applicable
Mark,

 

Is it of any benefit to attempt to link data w/o
the use of handles? The application I'm designing has a module that writes
information about a room, including RoomID, Description, Area, & Perimeter,
and also stores the handle of the LWPolyline used to identify & calculate
that information. I already have code to maintain/sync the handle info. But if I
am going down the garden path here, please let me know. Or is my information of
a different nature from yours?


--
R. Robert Bell, MCSE
Network
Administrator (or, Modern-day Wizard)
(remove the "not." in my address for
direct e-mail)

 

 
0 Likes
311 Views
11 Replies
Replies (11)
Message 2 of 12

Anonymous
Not applicable
Robert -

If your platform is A2K, I recommend DbConnect. There is some info on it
in the VBA online reference. Also, check out the Connectivity NG
(autodesk.autocad.connectivity).

DbConnect provides API's to build and maintain links between entities
and DBMS records. It is a good starting point for this type of
application. Using handles is awkward.

Mark Holder
0 Likes
Message 3 of 12

Anonymous
Not applicable
Doesn't that require the use of link templates? And is it true that link
templates cannot be created via VB?

--
R. Robert Bell, MCSE
Network Administrator (or, Modern-day Wizard)
(remove the "not." in my address for direct e-mail)

Mark Holder wrote in message
news:38B420DB.17F98DA9@atscorporation.com...
> Robert -
>
> If your platform is A2K, I recommend DbConnect.
0 Likes
Message 4 of 12

Anonymous
Not applicable
Robert -

They can't be created directly via the object model exposed by DbConnect,
but I adapt by inserting a dwg that already has the link templates I need
into any dwg that needs them.

If really necessary, an ARX app could be developed to expose the ability to
create them via ActiveX. That is beyond my current skill set.

Mark Holder

"R. Robert Bell" wrote:

> Doesn't that require the use of link templates? And is it true that link
> templates cannot be created via VB?
>
> --
> R. Robert Bell, MCSE
> Network Administrator (or, Modern-day Wizard)
> (remove the "not." in my address for direct e-mail)
>
> Mark Holder wrote in message
> news:38B420DB.17F98DA9@atscorporation.com...
> > Robert -
> >
> > If your platform is A2K, I recommend DbConnect.
0 Likes
Message 5 of 12

Anonymous
Not applicable
DBConnect is not the best tool for a functional App. Use the entity handle
in your database and add a small piece of xdata to you entity i.e. "Room
Number". Use the drawing name and the entity handle to refer to records in
your database. If your drawing gets corrupted, or GOD forbid, AutoCAD
crashes, you can use the xdata to re-link you data.

Hope this helps...
0 Likes
Message 6 of 12

Anonymous
Not applicable
Hmm, two differing ideas. Do I ever love newsgroups! OK Robert, I have
already taken the tack you posted, but I am curious as to your _reasons_ for
avoiding DBConnect. I am not so far into my project that I cannot change my
thinking (or programming).

--
R. Robert Bell, MCSE
Network Administrator (or, Modern-day Wizard)
(remove the "not." in my address for direct e-mail)

Robert P. Fahlin wrote in message
news:891cn7$ffc3@adesknews2.autodesk.com...
> DBConnect is not the best tool for a functional App. Use the entity
handle
> in your database and add a small piece of xdata to you entity i.e. "Room
> Number". Use the drawing name and the entity handle to refer to records
in
> your database. If your drawing gets corrupted, or GOD forbid, AutoCAD
> crashes, you can use the xdata to re-link you data.
>
> Hope this helps...
>
>
0 Likes
Message 7 of 12

Anonymous
Not applicable
Robert & Robert -

Here are some observations:

I been able to convert drawings linked to Access in R14 to Oracle in A2K without
destroying the old links (although I can delete 14 links with DbConnect if I
want). I can save as R14, and programs written for R14 still work.

In 4 years, I have never lost any linkage using the ASI links due to drawing
corruption (or any other cause). Obviously, I have only used DbConnect in A2K,
but I used ASE/ASI extensively in R14.

If you copy (with the copy command) an entity that was linked with DbConnect,
the copy is automatically linked.

If you WBLOCK entities, some of which have DbConnect links into a new drawing,
the links are still there and work correctly in the new drawing. Same for
copying and pasting into a new or existing drawing.

If you break a linked polyline into 2 segments, both pieces automatically retain
their links. If you explode one, each piece is still linked afterward.

Also, the structure of the links can be examined by anyone familiar with
DbConnect.

Autodesk provides DbConnect as their top of the line tool for external database
connectivity. If you do connectivity in A2K without it, you are wasting a
valuable resource.

Mark Holder

"R. Robert Bell" wrote:

> Hmm, two differing ideas. Do I ever love newsgroups! OK Robert, I have
> already taken the tack you posted, but I am curious as to your _reasons_ for
> avoiding DBConnect. I am not so far into my project that I cannot change my
> thinking (or programming).
>
> --
> R. Robert Bell, MCSE
> Network Administrator (or, Modern-day Wizard)
> (remove the "not." in my address for direct e-mail)
>
> Robert P. Fahlin wrote in message
> news:891cn7$ffc3@adesknews2.autodesk.com...
> > DBConnect is not the best tool for a functional App. Use the entity
> handle
> > in your database and add a small piece of xdata to you entity i.e. "Room
> > Number". Use the drawing name and the entity handle to refer to records
> in
> > your database. If your drawing gets corrupted, or GOD forbid, AutoCAD
> > crashes, you can use the xdata to re-link you data.
> >
> > Hope this helps...
> >
> >
0 Likes
Message 8 of 12

Anonymous
Not applicable
Robert -

What functionality can you get with handles that you cannot get with DbConnect?

Mark Holder

"Robert P. Fahlin" wrote:

> DBConnect is not the best tool for a functional App.
0 Likes
Message 9 of 12

Anonymous
Not applicable
And Another Thing:

With DbConnect, you don't have to modify the tables in your database to accomodate a
drawing name (and path?) and handle. You can link directly on the primary key
field(s) in your table. In most cases, that provides much faster lookup than a pair
of text fields, even if an index is available.

Mark Holder
0 Likes
Message 10 of 12

Anonymous
Not applicable
Ah, now I'm getting some nuggets!

OK, so say I want to use link templates now. I'll be working on 100's of
projects, in different folders (of course), with a unique database(s) for
each project. Does the Insert method for importing links work in this case?

--
R. Robert Bell, MCSE
Network Administrator (or, Modern-day Wizard)
(remove the "not." in my address for direct e-mail)
0 Likes
Message 11 of 12

Anonymous
Not applicable
Robert -

The short answer to your question is "Yes". Here's the LP:

A fact I have not seen published by Autodesk is that you can create and delete
links without connecting to the database at all. The only time you really have
to be connected is while you are creating a new link template "manually" -
through the DbConnect user interface. Using the Insert method, you can add link
templates without connecting to the database.

I'm assuming that all these databases share the same structure - at least as
far as table names and primary key field names. Otherwise, the same link
templates would not work - and you'd have to wear a dunce cap for asking that
question 🙂

Mark Holder

"R. Robert Bell" wrote:

> Ah, now I'm getting some nuggets!
>
> OK, so say I want to use link templates now. I'll be working on 100's of
> projects, in different folders (of course), with a unique database(s) for
> each project. Does the Insert method for importing links work in this case?
>
> --
> R. Robert Bell, MCSE
> Network Administrator (or, Modern-day Wizard)
> (remove the "not." in my address for direct e-mail)
0 Likes
Message 12 of 12

Anonymous
Not applicable
Dodged that bullet, at least! 8-)

--
R. Robert Bell, MCSE
Network Administrator (or, Modern-day Wizard)
(remove the "not." in my address for direct e-mail)
0 Likes