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.
How to make a duplicate of a part in featurescript
leti_ryder
Member Posts: 7 EDU
Hi guys!
I am trying to make a duplicate of a part in featurescript, I am using opPattern which requires a transform input. I am not sure what to enter.
I am trying to make a duplicate of a part in featurescript, I am using opPattern which requires a transform input. I am not sure what to enter.
var bfsBody = qCreatedBy(sketchId + "revolve1", EntityType.BODY);
var bfsBody = qCreatedBy(sketchId + "revolve1");
debug(context, bfsBody);
opPattern(context, id + "pattern1", {
"entities" : bfsBody,
"transforms" : transform(vector(1, 2, 50) * millimeter),
"instanceNames" : "scaled_body"
});
0
Answers
https://cad.onshape.com/FsDoc/library.html#module-transform.fs
Echoing @mahir. opPattern needs a "transform" of some sort to know what to do with the new item.
The transform and the name must be in an array [ ]. You can transform the new patterned entity to its original position like this:
If you wanted to pattern multiple items the transforms and the names must be separated by a comma:
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴