Skip to content

Commit

Permalink
Execute PyVista script without writing to a file
Browse files Browse the repository at this point in the history
  • Loading branch information
gha3mi committed Apr 16, 2024
1 parent c646e9d commit 6b4e4f1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
7 changes: 1 addition & 6 deletions src/forcad_nurbs_curve.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1207,12 +1207,7 @@ impure subroutine show(this, vtkfile_Xc, vtkfile_Xg)
")"//achar(10)//&
"p.show(title='ForCAD', interactive=True)"


open(newunit=nunit, file='pyvista_script.py', status='replace')
write(nunit, '(a)') pyvista_script
close(nunit)

call execute_command_line('python pyvista_script.py')
call execute_command_line('python -c "'//trim(adjustl(pyvista_script))//'"')
end subroutine
!===============================================================================

Expand Down
7 changes: 1 addition & 6 deletions src/forcad_nurbs_surface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1695,12 +1695,7 @@ impure subroutine show(this, vtkfile_Xc, vtkfile_Xg)
")"//achar(10)//&
"p.show(title='ForCAD', interactive=True)"


open(newunit=nunit, file='pyvista_script.py', status='replace')
write(nunit, '(a)') pyvista_script
close(nunit)

call execute_command_line('python pyvista_script.py')
call execute_command_line('python -c "'//trim(adjustl(pyvista_script))//'"')
end subroutine
!===============================================================================

Expand Down
7 changes: 1 addition & 6 deletions src/forcad_nurbs_volume.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2116,12 +2116,7 @@ impure subroutine show(this, vtkfile_Xc, vtkfile_Xg)
")"//achar(10)//&
"p.show(title='ForCAD', interactive=True)"


open(newunit=nunit, file='pyvista_script.py', status='replace')
write(nunit, '(a)') pyvista_script
close(nunit)

call execute_command_line('python pyvista_script.py')
call execute_command_line('python -c "'//trim(adjustl(pyvista_script))//'"')
end subroutine
!===============================================================================

Expand Down

0 comments on commit 6b4e4f1

Please sign in to comment.