This paper presents an approach to implement virtual fixtures for surgical robot assistants. Our approach uses a weighted, multi-objective (both linear and nonlinear) constrained optimization framework to formalize a library of virtual fixtures for task primitives. By our formulation, we provide a library of virtual fixtures on task primitives and a way to assemble multiple virtual fixture objects. We implement the constrained optimization problem with both linear and nonlinear constraints, and discuss the trade-offs between them. Moreover, we introduce the notion of "soft" virtual fixture mechanism for robotic surgical assistance. The "soft" virtual fixtures enable a surgical tool to have some resistance inside safety regions and no resistance in preferred regions.