how to constraint a part to move only axially, not depending on other parts?

how to constraint a part to move only axially, not depending on other parts?

I want to drag a part and it should move only axially, but it cannot be constrained to other parts, only to to origin or orgin planes. the axis is not conplanr to any origin plane

SolidworksAssemblies