kassab
2008-05-02, 03:27 PM
Hello everyone
I'm new to vb.net and AutoCAD programming so please take it easy on me
I’m converting vba code (that I wrote) to vb.net and i cant figure out how to set and get some file paths in my code. For example the plotstyle support path or the file support path.
here is the vba example that worked flawless
plotpath = ThisDrawing.Application.Preferences.Files.PrinterStyleSheetPath
supportpath = ThisDrawing.Application.Preferences.Files.supportpath
here is what i have so far in vb.net
Dim acadprefclass As Autodesk.AutoCAD.Interop.AcadPreferencesProfilesClass
Dim acadpref As Autodesk.AutoCAD.Interop.AcadPreferencesFiles
dim plotpath as string
dim supportpath as string
plotpath = acadpref.PrinterStyleSheetPath
supportpath = acadpref.SupportPath
Here is the error I get when I compile my code to a dll and run it in autocad
Object reference not set to an instance of an object.
If someone could help I would be very appreciate it greatly.
Moderator Note:
Please use [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code)
I'm new to vb.net and AutoCAD programming so please take it easy on me
I’m converting vba code (that I wrote) to vb.net and i cant figure out how to set and get some file paths in my code. For example the plotstyle support path or the file support path.
here is the vba example that worked flawless
plotpath = ThisDrawing.Application.Preferences.Files.PrinterStyleSheetPath
supportpath = ThisDrawing.Application.Preferences.Files.supportpath
here is what i have so far in vb.net
Dim acadprefclass As Autodesk.AutoCAD.Interop.AcadPreferencesProfilesClass
Dim acadpref As Autodesk.AutoCAD.Interop.AcadPreferencesFiles
dim plotpath as string
dim supportpath as string
plotpath = acadpref.PrinterStyleSheetPath
supportpath = acadpref.SupportPath
Here is the error I get when I compile my code to a dll and run it in autocad
Object reference not set to an instance of an object.
If someone could help I would be very appreciate it greatly.
Moderator Note:
Please use [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code)