Runtime error 1001 with AttachTo
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Runtime error 1001 with AttachTo

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
mthomas



Joined: 12 Aug 2005
Posts: 2

Posted: Mon Aug 15, 2005 12:37 pm    Post subject: Runtime error 1001 with AttachTo Reply with quote

Hi Everyone,

I am creating a new record and then attaching a polyline to it with the following code.

Dim acadApp As AcadApplication
Dim rec As Object 'ODRecord

Set acadApp = GetObject(, "AutoCAD.Application")
Set AcadMap = acadApp.GetInterfaceObject("AutoCADMap.Application")
Set obdTable = AcadMap.Projects(0).ODTables.Item("ARCS")
Set rec = gOdTable.CreateRecord()

rec.AttachTo (arc.ObjectID)

' arc As AcadObject (polyline)

But the line:
rec.AttachTo (arc.ObjectID)

gives me the following error:

Runtime Error '1001':
AutoCad MAP error.

It does not happen all the time. It appears to be random.
I cannot determine the reason for it.

Has anyone seen this better or have any ideas of what I am doing wrong?

Thanks
Michael

Back to top
View user's profile Send private message
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB