AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SaveNewObjs fails in Multi-User environment

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
216 Views, 0 Replies

SaveNewObjs fails in Multi-User environment

The following subroutine fails when a second user attaches to the
source drawings; It fails to create the memory set. This ONLY occurs
after the second (or more) user has attached source drawings.








Sub fSaveBckNewObjects(objId As Long, dwgName As String)

Dim poMapApp As AcadMap
Dim poPrj As AutocadMAP.Project
Dim poDset As DrawingSet
Dim poADwg As AttachedDrawing
Dim pbRet As Boolean
Dim lngIDArray(0) As Long
Dim strDwg As String


strDwg = "MAPS:\" & dwgName & ".dwg"
Set poMapApp =
ThisDrawing.Application.GetInterfaceObject("AutoCADMap.Application")
Set poPrj = poMapApp.Projects(ThisDrawing) 'current project document
Set poADwg = poPrj.DrawingSet.Item(strDwg) 'first attached drawing

lngIDArray(0) = objId
poPrj.SaveSet.AddObjects lngIDArray

Dim pvNew As Variant
pvNew = poPrj.SaveSet.GetObjects(kNewlyCreated)

pbRet = poADwg.SaveNewObjs(pvNew)
If pbRet Then
MsgBox ("Saved to memory")
Else
MsgBox ("Failed to save to memory")
End If

pbRet = poADwg.Save 'commit to attched drawing
If pbRet Then
MsgBox ("Saved to " & strDwg)
Else
MsgBox ("Failed to saveback to " & strDwg)
End If

End Sub
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost