Class Project - Getting & Saving to project settings

  • Thread starter Thread starter NachoShaw
  • Start date Start date
N

NachoShaw

Guest
Hey


probably a mundane question.. i have done this plenty of times in the past but for some reason, its not working on this class project.

Synopsis

  • Class project is an Inventor addin tool that loads with Inventor
  • Project written in VB.Net
  • Using project settings to store rudimentary information

OK, i am saving two strings to the project settings as string types, scope = user

  • sFilePath = \\MYSERVER\Inventor\2020\Z Templates\CNC-METRIC.idw
  • sTemplateName = CNC-METRIC

as my form loads, i an trying to get the values

txtTemplateName.Text = My.Settings.sTemplateName
txtFilePath.Text = My.Settings.sFilePath

This isnt getting the values from the project settings

On a button Click, i am trying to populate the project settings like this

If XtraOpenFileDialog1.ShowDialog = DialogResult.OK Then

Dim P As String = XtraOpenFileDialog1.FileName
Dim oGetDoc As Inventor.DrawingDocument = AddinGlobal.InventorApp.Documents.Open(P, False)
Dim s As String = oGetDoc.DisplayName

My.Settings.TemplateFilepath = P
My.Settings.TemplateFriendlyName = s
My.Settings.Save()

txtTemplateName.Text = s
txtFilePath.Text = P
oGetDoc.Close()
oGetDoc = Nothing
End If

This isnt populating the project settings either.


So, is the problem relating to it being a Class project vs a standalone?

is the settings file not being updated and i am in fact looking at an older version somewhere where the settings dont exist?

i would understand not writing to the settings if its a debug thing but i cant even get the values from the settings


Whats the deal?



Thanks :)


Nacho


Nacho is the derivative of Nigel - True fact! I am self taught in VB.Net. 50% of the time, I am right 100% of the time!

Continue reading...
 
Back
Top