.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

rebuild to 2013 .net

3 REPLIES 3
Reply
Message 1 of 4
scarta
723 Views, 3 Replies

rebuild to 2013 .net

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

 

3 REPLIES 3
Message 2 of 4
arcticad
in reply to: scarta

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

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



(defun botsbuildbots() (botsbuildbots))
Message 3 of 4
scarta
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)

 

 

Message 4 of 4
scarta
in reply to: arcticad

Now work!!

 

thanks

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost