Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
FeatureScript request: Auto adjust planes to max size of part
Bouwy
Member Posts: 16 ✭✭
Can a gifted someone program a FeatureScript to adjust the sizes (X,Y) of the standard geometry planes to the max size of the part with the press of a button?
This would be very helpful when importing or making new small parts.
This would be very helpful when importing or making new small parts.
Tagged:
1
Comments
annotation { "Feature Type Name" : "Default Planes" } export const defaultPlanes = defineFeature(function(context is Context, id is Id, definition is map) precondition { annotation { "Name" : "Part", "Filter" : EntityType.BODY, "MaxNumberOfPicks" : 1 } definition.part is Query; } { const boxResult = evBox3d(context, { topology : definition.part }); const partCenter = (boxResult.maxCorner + boxResult.minCorner) / 2; const origin = vector(0, 0, 0) * meter; const length = max(boxResult.maxCorner - boxResult.minCorner); const offsetLength = norm(origin + partCenter) * 2; definition.width = length + offsetLength; definition.height = length + offsetLength; definition.plane = plane(origin, vector(0, 0, 1), vector(1, 0, 0)); opPlane(context, id + 1, definition); definition.plane = plane(origin, vector(1, 0, 0), vector(0, 1, 0)); opPlane(context, id + 2, definition); definition.plane = plane(origin, vector(0, -1, 0), vector(1, 0, 0)); opPlane(context, id + 3, definition); });
@cody_armstrong; It is possible to change the planes but you have to do it manually. Nice workaround!, but changing the planes manually is my prefered method now.
@traveler_hauptman; Voted it up (apparently already did) and added a comment to the thread. Thanks!
Sound like a small adjustment in the source code of onShape, hope they change it soon!