.NET

Reply
Active Contributor
markgardiner
Posts: 48
Registered: ‎11-03-2003
Message 1 of 6 (231 Views)

findfile

231 Views, 5 Replies
05-23-2005 07:06 PM
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
*Mike Tuersley
Message 2 of 6 (231 Views)

Re: findfile

05-23-2005 09:01 PM 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...
*Albert Szilvasy
Message 3 of 6 (231 Views)

Re: findfile

05-24-2005 10:44 AM 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
*Tim Riley
Message 4 of 6 (231 Views)

Re: findfile

05-24-2005 12:39 PM 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
*Mike Tuersley
Message 5 of 6 (231 Views)

Re: findfile

05-24-2005 01:18 PM 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...
*Albert Szilvasy
Message 6 of 6 (231 Views)

Re: findfile

05-24-2005 02:55 PM 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.