- What is Auto Part Tagging?
- User Auto Tags
- Developer Auto Tags
- Default Tag in a Required Category
- Denying Auto Tags
- Part Tag Feedback
What is Auto Part Tagging?
Auto Tags lets you pick one or more part tags that will automatically be applied to all snappers placed thereafter, same as if you had tagged those snappers using the Tag individually tool.
User Auto Tags
Users can choose to add part tags using the new part tag item in the toolbar or change tags using the feedback toolbar.
Developer Auto Tags
Developers can choose to have a required PartTagCategory
by setting _required
to true. This makes isRequired()
return true.
/** * Is Required? */ extend public bool isRequired() { return _required; }
The snapper must also accept required categories in enforcePartTagCategory()
.
/** * Enforce Part Tag Category */ extend public bool enforcePartTagCategory(PartTagCategory category) { /** subclass */ return false; }
If both conditions are met the Snapper will always have a tag from the required category on insertion that the user cannot disable.
Default Tag in a Required Category
A developer may choose which tag from the category should be the default category using defaultAutoTag()
in PartTagCategory
. The normal default part tag will always be the first unless otherwise specified.
/** * IF isRequired() * Default Tag for this category */ extend public PartTag defaultAutoTag() { PartTag[] ts = tags(); if (ts and ts.any) return ts[0]; return null; }
Denying Auto Tags
Snappers that should not inherit auto tags can do so by setting snapper."denyAutoTags"
to true.
Part Tag Feedback
Feedback for what part tags are about to be applied will show up in a feedback toolbar at the bottom of the screen. This is shown by calling the following method inside of insertAnimation.begin()
.
/** * Show Part Tag Feedback */ public void showPartTagFeedbackTB(SnapperSelection selection, bool reqAutoOn=true) { if (reqAutoOn and !autoTaggingOnInsertEnabled) return; if (activeView.space.isNormal) for (z in selection.snappers) if (z.acceptExplicitTags) { ContextualViewToolbarModel model = ContextualPartTagFeedbackModel("taggingFeedback", args=props{selection=selection}); ContextualViewToolbar tb = PartTagFeedbackToolbar(activeView.window); tb = showContextualViewToolbar(activeView().window, model, visible=true, existing=tb); if (tb) { tb.show(); } break; } repaintAllActiveToolbars(); }
Comments
0 comments
Please sign in to leave a comment.