Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

opBoolean don't work

ivan_soldatovivan_soldatov Member Posts: 5
Hi all
https://cad.onshape.com/documents/6791ae7d97616661b011c396/w/b379dc7982120ded569f6f4c/e/3af5b1444179fb65254322c7

in lines 148 i'm use opBoolean,but operation don't work in main model.
If i'm use boolean operation in Onshape interface , this operation work good!.
Why  opBoolean don't work in feature script in this case?



Tagged:

Comments

  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,173
    The trouble is with the queries -- somewhat counter-intuitively, a union operation does not create bodies, it merges existing ones.  So instead of
    qCreatedBy(id + "union", EntityType.BODY)
    you want
    qCreatedBy(id + "cylinder1", EntityType.BODY)
    The way to tell that this is the case is that a "CANNOT_RESOLVE_ENTITIES" error occurs when a query doesn't find anything for an operation that needs something.  To tell which query is problematic, use the debug function:
    debug(context, qCreatedBy( id + "union", EntityType.BODY));
    will print "debug: Query resolves to nothing" to the console, indicating the problem.

    BTW, very very soon, we'll be releasing configurations, which will make this type of work much easier (because you'll be able to model the bolt with all the parameters directly in a part studio).  We'll also be releasing standard content (i.e., nuts, bolts, etc.) but ГОСТ will not be among the standards we initially release.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • ivan_soldatovivan_soldatov Member Posts: 5
    Thanks ilya .
    BTW, very very soon, we'll be releasing configurations, which will make this type of work much easier (because you'll be able to model the bolt with all the parameters directly in a part studio).  We'll also be releasing standard content (i.e., nuts, bolts, etc.) but ГОСТ will not be among the standards we initially release.
    very necessary!
    In this moment,  a very monotonous task coding standard detail dimensions...
    I'm using "map" object for select in user interface, then select value "if-else" - this way generated
    a lot of code.
    this is the only good way now?
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    hi @ivan_soldatov
    you may take a look at my Feature pattern FS, it generates instances of geometry that is defined by variables. so you can build one instance of the screw using native onshape features and then variate variable driven dimmentions in other instances.
    https://cad.onshape.com/documents/d66ea5fec7a939e866ecbd6f/w/25d8c7ecb4fba2c4e6eb34a4/e/91b645e7d9869fba22a1ab11
    the only big problem is in a bunch of auto-generated meaningless part names :)



  • ivan_soldatovivan_soldatov Member Posts: 5
    edited January 2018
    Thanks for share @konstantin_shiriazdanov  nice work.I will study how this work. :)
    But, I want using interface for select parameter, and change parameter after select value.
    Also , I want select  bolt GOST (several) ,them script recalculate parameters and rebuilt geometry.

    How do you think this is possible using FS?
    How compact organize data table ?

  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    Also , I want select  bolt GOST (several) ,them script recalculate parameters and rebuilt geometry.

    How do you think this is possible using FS?
    How compact organize data table ?

    the problem is that you still need to have a part studio with a bunch of calls of your feature - one per each bolt, and it wouldn't solve the problem of auto-generated part names. though looking at your feature i think you doing it right way by means of lookup table
Sign In or Register to comment.