visual studio - Run Revit 2016 with selected affinity vb.net -


i've been trying run revit 2016 selected process affinity of choice:

affinity http://i63.tinypic.com/2vhzvya.jpg

below current code suppose run on cpu 0 (or maybe cpu 1):

private sub button5_click(sender object, e eventargs) handles button5.click myprocess.startinfo.filename = "c:\program files\autodesk\revit 2016\revit.exe" myprocess.start() dim thread processthread = process.getprocessbyid(myprocess.id).threads(0) thread.idealprocessor = 1 thread.processoraffinity = ctype(1, intptr) dim instance process = process.getprocessbyid(myprocess.id) instance.processoraffinity = new intptr(1) instance.processoraffinity = ctype(1, intptr) end sub 

unfortunately code not work every time, works every few launches, , other times, after going task manager, still find revit running on processors :(

it appreciated if can give me hint i'm missing.

many thanks,


Comments