vb.net - SolidWorks API, Macro working in VSTA but not from dll -


really appreciate can spend couple of minutes me out, in advance !

got myself situation running macro in vsta works (vb.net), running dll files solid works not work. forgetting simple. principle text file in same folder dll files , default read folder without long location "string"

this works in vsta , after building dll (very simple)

partial class solidworksmacro     public sub main()         dim model modeldoc2 = swapp.activedoc         dim layername string = "stamp"         msgbox(layername)     end sub     public swapp sldworks end class 

no want same thing in way layer name read text file. works when running vsta, after building dll , running solid works gives error: cannot open

"location"\macro.dll.

partial class solidworksmacro     public sub main()         dim model modeldoc2 = swapp.activedoc         dim layername string = "stamp"         dim filename string = "layername.txt"         dim layername string         dim sr new streamreader(filename)         layername = sr.readline         msgbox(layername)     end sub     public swapp sldworks end class 

how planning on running code? have build out additional functionality create button/taskpane/property page through api solidworks know want do. little more complicated running macro. references did add project? need add @ least:

  • solidworks.interop.sldworks
  • solidworks.interop.swpublished

are implementing iswaddin interface? also, have not had luck merely opening dll solidworks, use regasm.exe register com dll or create wix installer create registry entries if distributing multiple machines.

the getting started page in api reference see examples , how configure environment.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -