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.
Another feature script ID error...
darren_13
Member, Developers Posts: 119 PRO
@opPlane: Parent Id FIZxwPCJn00T9Nq_1.0 used at two non-contiguous points in operation history (Cannot have FIZxwPCJn00T9Nq_1.deleteBodies2.3 between FIZxwPCJn00T9Nq_1.0.SparPlanes and FIZxwPCJn00T9Nq_1.0.0)
I don't know what is wrong with this clearly the ID'd are different because they are unique strings... the ID + i + string should be seen as unique if ALL of those are the same then there should be an issue, otherwise, it should be fine?
Thanks in advance,
Darren
I don't know what is wrong with this clearly the ID'd are different because they are unique strings... the ID + i + string should be seen as unique if ALL of those are the same then there should be an issue, otherwise, it should be fine?
Thanks in advance,
Darren
Tagged:
0
Comments
the document is located in folder 'wing structure creator' and the script is the second one 'wing structure parametric'
I changed it a little here is the input:
and here is the new error:
@opPlane: Parent Id FIZxwPCJn00T9Nq_1.IBeamPlanes used at two non-contiguous points in operation history (Cannot have FIZxwPCJn00T9Nq_1.halfSplit.0 between FIZxwPCJn00T9Nq_1.IBeamPlanes.0 and FIZxwPCJn00T9Nq_1.IBeamPlanes.1)
the problem I believe is on line 391
Cheers,
Darren
The first problem is actually in line 321, where the id should be id + "SparPlanes" + i rather than id + i + "SparPlanes" -- this is backwards from the usual advice of id + index + operation, but in your case, you have multiple for loops in your feature, so you need a unique string id to distinguish them that must come before the iterator variable. Your other loops do this.
The second issue I can see is where you suspect: the ids in lines 391 and 399. Change
id + "IBeamPlanes" + i to id + "loopId" + i + "IBeamPlanes"
and
id + "halfSplit" + i to id + "loopId" + i + "halfSplit"
(where "loopId" is whatever you want to call that entire loop) and I think the ids at least should work.
Darren
In seriousness, I agree about annoying, but I think it is largely necessary. The necessity for the id system stems from the fact that downstream features have to refer robustly to topology created by the custom feature, and the hierarchical ids are part of what makes this possible (they also make it possible for features to control somewhat how the references resolve if the feature definition changes). As complicated as it is for the FS authors, it's far more complex on the inside, but I think that's the price of exposing parametric regeneration as much as we have.