Closed riteshsv closed 4 years ago
@riteshsv how is your progress so far? are there any difficulties?
@idhamari I had to go out of town for some work. I will get started today and get over with it asap.
@idhamari I have implemented Use Case 1 and Use Case 2 as mentioned above.
Below is the example code to test the same:
#usage of loadModel function
m=vsSim.loadModel('/Users/ritesh/test2.osim')
m.getName() #print the name of model
'test2'
m.setName('test3') #change the name of model
vsSim.updateModelToNavigator(m) #update the changes to navigator
#example of create a new model and add to navigator
m2 = osim.Model()
m2.setName('createdModel') #set the name of new model
m2.setInputFileName('/Users/ritesh/createdModel.osim') #set the path of model file to be created
vsSim.setModelToNavigator(m2) #add the new model to navigator
#example of get current active model from the navigator
m3 = vsSim.getCurrentModel() # get the current active model
m3.getName() # prints the name of current active model
'createdModel'
m3.getInputFileName() #prints the file path of model
'/Users/ritesh/createdModel.osim'
#example of get a model from navigator by model name
m4 = vsSim.getModelFromNavigator('test3') #get test3 model from the navigator
m4.getName() #print name of the model got from navigator
'test3'
m4.setName('test5') #change the name of model
m4.getGravity() #get the gravity of model
<opensim.simbody.Vec3; proxy of <Swig Object of type 'SimTK::Vec< 3 > *' at 0x13c0bbf30> >
g = m4.getGravity()
vsSim.updateModelToNavigator(m4) #update the changed name to navigator
I have committed the code. Please let me know what time I can give a demo. In the mean time I will start working on other item.
@riteshsv looks excellent :watermelon: , I will test it and provide feedback if needed
@idhamari I got a weird bug today morning and spend the whole day trying to resolve it. Its kind of weird, but sometimes it happens. Please allow me 2 more days.
With reference to the below quote :