Cubit.cmd commands not parsing correctly

Hello,
I’m using Trelis 17.1 Pro.
I’m likely making some elementary error, but when I execute the following code from a .jou file using the play journal file button:

#!python

cubit.cmd('reset')

step_path = '/home/username/testcode/project/file.step'
cubit.cmd('import step ' + step_path + ' heal')

I get the following error

Trelis>import step ' + step_path + ' heal
ERROR: /home/username/testcode/project/project-main.jou (8). You must enter a filename

Could you please help me fix this?
Thanks.

I think you might need to put the step_path in quotes

Perhaps try

cubit.cmd('import step "' + step_path + '" heal')

Note the different style of quotes used " around the step_path variable

3 Likes