Link Template and VB.Net

Link Template and VB.Net

Anonymous
Not applicable
614 Views
5 Replies
Message 1 of 6

Link Template and VB.Net

Anonymous
Not applicable
I'm trying to create a link template using VB.NEt

does anyone have sample code I could use to get started?
I check in the Map ObjectArx 2.0 but I could not find any sample.

thank you

Louis
0 Likes
615 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
I ran into this a few months ago. At that time I couldn't find any .NET port of the Connectivity Automation Object (CAO)...and I ended up using the COM CAO object to work with Link Templates.

Scott Friedrich
0 Likes
Message 3 of 6

Anonymous
Not applicable
thank you!
0 Likes
Message 4 of 6

Anonymous
Not applicable
... null
0 Likes
Message 5 of 6

Anonymous
Not applicable
I have finally been able to create a link template using the CAO COM component.

now, I need to create a link between a table entry and an object.

I found the following command:
LT.CreateLink(ObjectID as Integer, pKeyValues as CAO.KeyValues)
where LT is a CAO.LinkTemplate obtained from the creation of the new LinkTemplate (objLinkTemplate.Add[...])

for the ObjectID parameter, can I simply use a Autodesk.Autocad.DatabaseServices.ObjectID (converted to a string)

for the pKeyValues parameter, I need to create a new keyValue, using:
keyValues.add(fieldName as string, value as Object)

what does the value parameter represent? The object I want to connect to?
0 Likes
Message 6 of 6

Anonymous
Not applicable
I found what I was doing wrong

it was in the LT.CreateLink(ObjectID as integer, pKeyValues as CAO.KeyValues)

for the ObjectID parameter, I was doing something like this

dim id as ObjectId
'get the ObjectId of an entity
[...]
dim intId as integer
intId = Cint(id.ToString)

instead of doing:
intID = id.OldId

I was always getting a fatal error that caused AutoCad to close.

Hope this might be of some help to someone
0 Likes