.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 6
markgardiner
998 Views, 5 Replies

findfile

Hi,

I am trying to use the .net findfile but I am getting the eror
CS0120: An object refernce is required for the nonstatic field, methor or property

Database db = HostApplicationServices.WorkingDatabase;
FindFileHint hnt = 0;
System.String fileName= "acaddoc.lsp";
string retpath = HostApplicationServices.FindFile(fileName, db , hnt);

Thanks
Mark
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: markgardiner

using System.IO

public bool GetBlocks()
{
try {
if (m_sBlkPath != vbNullString) {
Directory oDir;
File oFile;
oDir.GetDirectories(m_sBlkPath);
string[][0] cFiles;
string sFile;
cFiles = oDir.GetFiles(m_sBlkPath, "*.dwg");
if (cFiles.Length > 0) {
string sFileName;
foreach (int sFile in cFiles) {
console.writeline Path.GetFileNameWithoutExtension(sFile);
}
}
}
return true;
} catch (Exception ex) {
return false;
}
}


-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
Message 3 of 6
Anonymous
in reply to: markgardiner

Try this:
HostApplicatonServices.Current.FindFile(...)

Note that FindFile has a bug on R2005 that renders it pretty much unusable.
This bug was fixed in R2006.

Albert

wrote in message news:4854062@discussion.autodesk.com...
Hi,

I am trying to use the .net findfile but I am getting the eror
CS0120: An object refernce is required for the nonstatic field, methor or
property

Database db = HostApplicationServices.WorkingDatabase;
FindFileHint hnt = 0;
System.String fileName= "acaddoc.lsp";
string retpath = HostApplicationServices.FindFile(fileName, db , hnt);

Thanks
Mark
Message 4 of 6
Anonymous
in reply to: markgardiner

Are any of these bugs being fixed and released in service packs for 2005?

Tim Riley

"Albert Szilvasy" wrote in message
news:4854861@discussion.autodesk.com...
Try this:
HostApplicatonServices.Current.FindFile(...)

Note that FindFile has a bug on R2005 that renders it pretty much unusable.
This bug was fixed in R2006.

Albert

wrote in message news:4854062@discussion.autodesk.com...
Hi,

I am trying to use the .net findfile but I am getting the eror
CS0120: An object refernce is required for the nonstatic field, methor or
property

Database db = HostApplicationServices.WorkingDatabase;
FindFileHint hnt = 0;
System.String fileName= "acaddoc.lsp";
string retpath = HostApplicationServices.FindFile(fileName, db , hnt);

Thanks
Mark
Message 5 of 6
Anonymous
in reply to: markgardiner

Not sure but my guess would be no since 2k6 exposes more to managed and is
not a simple "patch" onto the exposure of 2k5. Also since this is a
progression forward to full managed exposure, I doubt they'd go back and
fix something.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
Message 6 of 6
Anonymous
in reply to: markgardiner

No, there's no 2005 sp or hotfix for this. You can work around it by calling
the underlying C++ API directly.

Albert

"Tim Riley" wrote in message
news:4855036@discussion.autodesk.com...
Are any of these bugs being fixed and released in service packs for 2005?

Tim Riley

"Albert Szilvasy" wrote in message
news:4854861@discussion.autodesk.com...
Try this:
HostApplicatonServices.Current.FindFile(...)

Note that FindFile has a bug on R2005 that renders it pretty much unusable.
This bug was fixed in R2006.

Albert

wrote in message news:4854062@discussion.autodesk.com...
Hi,

I am trying to use the .net findfile but I am getting the eror
CS0120: An object refernce is required for the nonstatic field, methor or
property

Database db = HostApplicationServices.WorkingDatabase;
FindFileHint hnt = 0;
System.String fileName= "acaddoc.lsp";
string retpath = HostApplicationServices.FindFile(fileName, db , hnt);

Thanks
Mark

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