.NET

Reply
Valued Contributor
scarta
Posts: 52
Registered: ‎11-25-2008
Message 1 of 4 (527 Views)

rebuild to 2013 .net

527 Views, 3 Replies
05-16-2012 07:57 AM

Hi, I have to rebuil a vb.net dll (2012) for use it with AutoCAD1013

I use visual studio Express 2010 and i receive the error "open is not a member of  'Autodesk.AutoCAD.ApplicationServices.DocumentCollection' on this line:

 

myDWG = acDocMgr.Open(cartOrigine,False)

 

i have changed reference to 2013 and add a ref to accoremgd

someone can help me?

 

 

Imports Autodesk.AutoCAD.Runtime

Imports Autodesk.AutoCAD

Imports Autodesk.AutoCAD.DatabaseServices

Imports Autodesk.AutoCAD.ApplicationServices

Imports Autodesk.AutoCAD.Geometry

Imports Autodesk.AutoCAD.EditorInput

Imports Autodesk.AutoCAD.Colors

Imports System

Imports System.Windows.Forms

Imports System.Math

'formati saveas

'MC0.0 - DWG from Rel. 1.1

'AC1.2 - DWG from Rel. 1.2

'AC1.4 - DWG from Rel. 1.4

'AC1.50 - DWG from Rel. 2.0

'AC2.10 - DWG from Rel. 2.10

'AC1002 - DWG from Rel. 2.5

'AC1003 - DWG from Rel. 2.6

'AC1004 - DWG from Rel.9

'AC1006 - DWG from Rel.10

'AC1009 - DWG from Rel.11/12 (or LT R1/R2)

'AC1012 - DWG from Rel.13 (or LT95)

'AC1014 - DWG from Rel.14, 14.01 (or LT97/LT98)

'AC1015 - DWG from AutoCAD 2000/2000i/2002 (or LT, Map or relative Desktop version)

'AC1018 - DWG from AutoCAD 2004/2005/2006 (or other product in the "2004", "2005" or "2006" family)

'AC1021 - DWG from AutoCAD 2007/2008/2009 (or other product of the "2007", "2008" and "2009" families)

'AC1024 - DWG from AutoCAD 2010 (or other product of the "2010" family)

Public

ClassCart_Auto

<

CommandMethod("cartauto", CommandFlags.Session)> _

 

PublicSubcartauto()

 

Dim strPath AsStringDim strPathDest AsStringDim strNomeFile AsStringDim strTargetFile AsStringDim cartOrigine AsStringDim intpointer AsIntegerDim pos_Pipe(1) AsObjectDim Titolo(5) AsStringDim max_digit, contrTitolo, contrTitoloMax AsIntegerDim myDB As DatabaseServices.DatabaseDim myDWG As ApplicationServices.DocumentDim myEd As EditorInput.EditorDim myPFR As EditorInput.PromptFileNameResultDim myPFO AsNew EditorInput.PromptOpenFileOptions("Select a file:")

 

Dim strNomeBlocco AsString'= "blocco_attributo"Dim nomeSpazio AsString

strPath = Autodesk.AutoCAD.ApplicationServices.

Application.GetSystemVariable("dwgprefix")

 

' carico il file delle impostazioni

myDWG = ApplicationServices.

Application.DocumentManager.MdiActiveDocument

myDB = myDWG.Database

myEd = myDWG.Editor

myPFO.DialogCaption =

"Seleziona File Impostazioni..."

myPFO.InitialDirectory = strPath

myPFO.Filter =

"File INI|*.ini"

myPFR = myEd.GetFileNameForOpen(myPFO)

SelectCasemyPFR.Status

 

Case EditorInput.PromptStatus.Cancel

MsgBox(

"User Cancelled.")

 

EndSelect

strNomeFile = myPFR.StringResult

Dim myFSW1 AsNew IO.StreamReader(strNomeFile)

 

Dim txtLine1 AsString'While myFSW1.EndOfStream = False

txtLine1 = myFSW1.ReadLine

txtLine1 = myFSW1.ReadLine

cartOrigine = txtLine1

txtLine1 = myFSW1.ReadLine

txtLine1 = myFSW1.ReadLine

strPathDest = txtLine1

txtLine1 = myFSW1.ReadLine

txtLine1 = myFSW1.ReadLine

max_digit = Val(txtLine1)

txtLine1 = myFSW1.ReadLine

txtLine1 = myFSW1.ReadLine

contrTitolo = Val(txtLine1)

txtLine1 = myFSW1.ReadLine

txtLine1 = myFSW1.ReadLine

contrTitoloMax = Val(txtLine1)

txtLine1 = myFSW1.ReadLine

txtLine1 = myFSW1.ReadLine

strNomeBlocco = txtLine1

txtLine1 = myFSW1.ReadLine

txtLine1 = myFSW1.ReadLine

nomeSpazio = txtLine1

 

 

'End While

myFSW1.Close()

' carico il file elenco

myDWG = ApplicationServices.

Application.DocumentManager.MdiActiveDocument

myDB = myDWG.Database

myEd = myDWG.Editor

myPFO.DialogCaption =

"Seleziona File Elenco..."

myPFO.InitialDirectory = strPath

myPFO.Filter =

"File Testo|*.TXT"

myPFR = myEd.GetFileNameForOpen(myPFO)

SelectCasemyPFR.Status

 

Case EditorInput.PromptStatus.Cancel

MsgBox(

"User Cancelled.")

 

EndSelect

 

 

strNomeFile = myPFR.StringResult

 

 

Dim myFSW AsNew IO.StreamReader(strNomeFile)

 

Dim txtLine AsStringDim acDocMgr AsDocumentCollection = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager

 

Dim doc1 AsDocument

 

While myFSW.EndOfStream = False

txtLine = myFSW.ReadLine

If Left(txtLine, 1) = "|"Or txtLine.ToUpper = "FINE"ThenGoToa101

 

EndIf

myDWG = acDocMgr.Open(cartOrigine,False) ' apre il cartiglio di origine

 

*Expert Elite*
arcticad
Posts: 1,285
Registered: ‎06-21-2004
Message 2 of 4 (523 Views)

Re: rebuild to 2013 .net

05-16-2012 08:05 AM in reply to: scarta

http://forums.autodesk.com/t5/NET/Open-is-not-a-member-of-ApplicationServices-DocumentCollection/m-p...

---------------------------



(defun botsbuildbots() (botsbuildbots))
Valued Contributor
scarta
Posts: 52
Registered: ‎11-25-2008
Message 3 of 4 (521 Views)

Re: rebuild to 2013 .net

05-16-2012 08:24 AM in reply to: arcticad

thanks... I do not understand where I have to correct

i have changed Documentcollection with ocumentcollectionextension..but not wok

 

Dim acDocMgr As DocumentCollectionExtension

 

Dim myDWG As ApplicationServices.Document

 

acDocMgr = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager

 

myDWG = acDocMgr.Open(cartOrigine,False)

 

 

Valued Contributor
scarta
Posts: 52
Registered: ‎11-25-2008
Message 4 of 4 (514 Views)

Re: rebuild to 2013 .net

05-16-2012 08:56 AM in reply to: arcticad

Now work!!

 

thanks

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!