0 Members and 1 Guest are viewing this topic.
Quote from: T.Willey on August 30, 2006, 05:54:52 PMQuestion: When using the code provided, can I pass the database (db) to sub-functions? or do I have to try something else?Yes. You can pass Database any function (really reference will be passed).QuoteIt looks like it might work, but I get an error when trying the command in Acad. Here is the main part of the rouine. If needs be I can post the whole code.What error message? Are you trying to debug this code? Debugging maybe very usefull.
Question: When using the code provided, can I pass the database (db) to sub-functions? or do I have to try something else?
It looks like it might work, but I get an error when trying the command in Acad. Here is the main part of the rouine. If needs be I can post the whole code.
Just a quick guess, perhaps a Doclock may be required.
Got the same error, but I used it on the current drawing, is that correct?
Quote from: T.Willey on August 30, 2006, 06:26:46 PMGot the same error, but I used it on the current drawing, is that correct?IMHO yours code can not work with current drawing (or any other drawing opened in AutoCAD).If you can not use debugger (I do not know why it is not installed), use any kind of dialog messages in order to localize place of error.
If you're using Database.Save() then it doesn't seem to work.You will have to use Database.Saveas()...found that out a while ago.Hope this helps.Cheers,Glenn.
public virtual void SaveAs( string FileName, object vSecurityParams)
To specify security parameters, set pSecurity to point to a SecurityParams struct that conveys your preferences. If pSecurity is non-NULL, its settings override any previous database security settings. If pSecurity is NULL, any currently enforced security settings remain in effect. If no previous security-related settings were specified, and pSecurity is NULL, no security-related operation is attempted. If the SecurityParams struct passed as the pSecurity argument is not properly initialized, the method fails. See SecurityParams for more information on initializing this struct.
In times like these it helps to have a look at the arx api for a bit of guidence.QuoteTo specify security parameters, set pSecurity to point to a SecurityParams struct that conveys your preferences. If pSecurity is non-NULL, its settings override any previous database security settings. If pSecurity is NULL, any currently enforced security settings remain in effect. If no previous security-related settings were specified, and pSecurity is NULL, no security-related operation is attempted. If the SecurityParams struct passed as the pSecurity argument is not properly initialized, the method fails. See SecurityParams for more information on initializing this struct.So, with that I'd try a 'null' or SystemType.Missing (or what ever it is )
dbxDoc.SaveAs (dbxDoc.Name, new Autodesk.AutoCAD.DatabaseServices.SecurityParameters());
dbxDoc.SaveAs (dbxDoc.Name, new Autodesk.AutoCAD.Interop.Common.SecurityParams());
If you tried SystemType.Missing then that won't work.It should be System.Type.Missing.