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.

FeatureScript User Community Spotlight

24567

Comments

  • Ben_Ben_ OS Professional, Mentor, Developers Posts: 290 PRO
    edited April 2017
    I have played with this and for the life of me I cannot get the dialog to show the "angle step" any suggestions?
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    Hi, @Ben_ make sure you are in B1 workspace, and be careful with angle step, if the number of iterations is too big part studio gets laggy (this is why i call it Laggy Gearz)
  • Ben_Ben_ OS Professional, Mentor, Developers Posts: 290 PRO
    B1? Branch one? If I'm correct yes I am in branch one and still no luck
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited April 2017
    @Ben_ B1 seems to be the second branch, if you are in B1 workspace and seeing those old version of realization it may be some kind of bug
    and one more observation about bahavior of this FS - looks like opBoolean which is used internally fails when bodies at some angle have a tangent surfaces. it can also be used for bodies with non parallel axis like bevel gears and worm gearing




  • Ben_Ben_ OS Professional, Mentor, Developers Posts: 290 PRO
    I'll give it a try later, seriously this is awesome, on my copied version B1 did not copy over so maybe that was my issue. I should have looked at the original.
  • Ben_Ben_ OS Professional, Mentor, Developers Posts: 290 PRO
    edited April 2017
    Updated the script and all works now FYI. This is a super helpful tool for me and my work. Thank you! 
    On a side project I have wanted to design up a clock using gears like this. I know that the chances of it working are slim but one hast to try... 

  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited April 2017
    @Ben_ glad it was useful for you. Wish OS developers to implement native functionality from Parasolid kernel  for smooth and fast generation of the envelope surfaces (if it exists). For now it is only possible such approximate descrete algorithms. Though it's better than nothing in a bunch of other CADs


  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited June 2017
    I made some improvements to the Measure Distance FS. Now it can handle infinite propagation of measured entities and can measure angles as well. So here it is - Measure Distance Extended.
    https://cad.onshape.com/documents/77baa8153589a7fc5f289829/w/cffd0f2a7077380d5378a885/e/d3174bf5315e6aafcb889367




  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    FS for wrapping sketched curves around cone and cylinder surfaces like 3d curves
    https://cad.onshape.com/documents/0bb13c1b6ed6d4a6dd75cf99/w/b4493d47a45c27ce485c84b9/e/c8050a35a7417c12b801bd40



  • mahirmahir Member, Developers Posts: 1,221 ✭✭✭✭✭
    This FS is a modification of the curve pattern FS that allows you to orient the seed features/bodies/surfaces to maintain their normal position relative to a reference surface. Without the reference surface, the pattern direction is controlled by the curve's tangency. The first pic is without a reference surface. The second is with.

    FeatureScript Curve Pattern Normal
     



    And this FS does something similar with sweeps. It will maintain a sweep profile's normalcy relative to a reference surface instead of the sweep path. The red surface doesn't have a reference surface. The green surface does.

    FeatureScript Sweep Normal

  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited July 2017
    @mahir, could you please add ability to select wire bodies for sweep path in your SweepNormal FS, like it is done in traditional Sweep
    annotation { "Name" : "Edges and sketch curves to sweep",<br>             "Filter" : (EntityType.EDGE && ConstructionObject.NO) <b>|| (EntityType.BODY && BodyType.WIRE)</b>}


  • mahirmahir Member, Developers Posts: 1,221 ✭✭✭✭✭
    @konstantin_shiriazdanov, done. Wire body support was also added to Curve Pattern Normal.
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited July 2017
    @mahir

    it was a quick response :) , but wire bodies are added for edges to sweep, i need them in sweep path too) thanks in advance

  • mahirmahir Member, Developers Posts: 1,221 ✭✭✭✭✭
    Picky picky :P Done.
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited July 2017
    would like to share my FS RectToPolar, it allows to create flat cam profiles based on the 2d sketch with law of motion and sketch coordinate system (defined by mc). Internally it is a modification of SketchWrapper FS for plane to plane mappings.
    https://cad.onshape.com/documents/b59ab933bf1592e02614330f/w/a58753fdbb92959793980f44/e/ded816b2c095eb1569913c85



  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited July 2017
    Curve generator FS - generates parametric curves based on sketch relations between variable-driven geometrical constraints and a point.
    All you need to generate the tragectory of the point or graph in rectangular/polar/some another crazy 2d coordinate system - draw the fully constraint sketch, containing relations in dimentions with some external variable without referenses to external geometry (no workplanes and even origin allowed), put inside the sketch a single point (one and only point per sketch allowed), select the sketch, insert variable name, min/max value and step.
    https://cad.onshape.com/documents/d8aab1e0e7ae10038a6830e0/w/9dfdd631d025960813b8f2df/e/621b5be97d38074a1f1546e5
    update: in V4 version of this FS was added support of local coordinate system (mate connector) which may be linked with some wire of the sketch and relative path of the point will be calculated considering that coordinate system bieng static.


  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 552
    @konstantin_shiriazdanov
    Just a heads up on your feature above: I'd document that your sketch need to add a "fix" constraint to any sketch entities constrained to external geometry, like I've done here:
    The reason is that sketch patterns remove external constraints (e.g. coincident to origin/external geometry) before patterning. We do this because generally you want the sketch to move when being patterned. However, it can have strange effects in some cases. With your feature, I believe in most cases a fix constraint will be the right solution.
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    thanks for clarification, Kevin. I silently implied it, after faced that effects while debugging :)


  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 552
    edited July 2017
    As a debugging aid, it may also be worth doing single pattern without changing the variable, verifying the result did not move. If it does, you can throw an error or reportFeatureInfo that the sketch needs to be fully constrained with fixed constraints on external entities.

    Otherwise, it's a really awesome tool!
  • mahirmahir Member, Developers Posts: 1,221 ✭✭✭✭✭
    @konstantin_shiriazdanov nice work. At first I didn't see the advantage over my Parametric Curve FS since if you stick to standard coordinate systems, this FS generates the same type of curve, but only 2D instead of 3D. However, the ability to generate arbitrary kinematic paths using geometric construction is pretty handy. All of these curves could be deconstructed into y=f(x), but that is often a non-trivial task. Kudos.
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    @mahir, yes if we already have explicit formulas your parametric curve is what we need, my feature uses the power of 2-d solver, without necessity to use external sofware for kinematics/math modeling. When 3d-sketch functionality will appear i'll try to extend functionality of this for 3d curves
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,709 PRO
    Thank you @konstantin_shiriazdanov for one of the most useful feature scripts I've used to date.
    Measure Distance Extended:
    https://cad.onshape.com/documents/77baa8153589a7fc5f289829/w/cffd0f2a7077380d5378a885/e/d3174bf5315e6aafcb889367

    With this simple tool I was able to "manually" flatten my large diameter "fake-sheet-metal" part and keep it parametric with it's parent
    Excellent tool sir!


  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited July 2017
    @john_mcclary
    nice to hear it was usefull, I only improved a good idea. I didn't documented Perimeter option elswhere, so I'd like to mention that it can measure perimeters of faces (not only planar), and total length of any set of edges and face perimeters with any combination, so the main thing is not to select something you don't want to measure)

  • MichaëlMichaël Member, Developers Posts: 2
    Brilliant... I was wondering how to model a logarithmic spiral. Look into the forum for the past year and not much was usable out of the box. I then your work came up. Life saver! Hats off...
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited July 2017
    made a modification of Curve generator FS for tracing dependences betwen driving and driven parameters of a planar mechanism with one degree of freedom defined by fully constrained sketch, driving dimention (for example "x") is a user defined variable, driven dimention (for example "y") should be defined as variable from Measure distance extended FS (with hide distance preview option turned on). Tracer prints the list of the points with the given step to the console in the format {{x1,y1},{x2,y2},{x3,y3},...}, and creates a graph representing y(x) dependency on the top view plane.
    https://cad.onshape.com/documents/2e01af46ce2cd5b90ee41156/w/82761270dd57ac2be5d84860/e/274c362e3eeb03f14eaa43c1




  • evdokia_ershovaevdokia_ershova Member Posts: 1
    thanks a lot guys, i've found some really useful information and some amazing ideas here reading through your posts people.
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited August 2017
    Some changes to Measure distance extended FS
    - added single query field for a pair of measured entities instead of two fields for two sets of entities
    - added ability to hide distance preview (should be used when using this FS with Tracer FS to not to clutter console output by debug messages)
    - added ability to flip angle value to (180 deg - angle_value)
    - added ability to measure vertex coordinates
    - remooved "horizontal enum" gui, now options are in the drop-down list
    this version of FS is NOT backward compatible with prevous versions, so do not update your old documents, or you have to select query parameters manualy

  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    Have something new about curve transforms - Flex FS.
    It takes sketch edges or regions and transforms them like if target curve would become a X axis of the sketch. It bends the sketch along some curve.
    So it is one more way of making flat cams, text along spline, etc.
    https://cad.onshape.com/documents/0bb13c1b6ed6d4a6dd75cf99/w/b4493d47a45c27ce485c84b9/e/964f73eb0179aad8733b9f23



  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    edited November 2017
    This FS was inspired by Point pattern FS - Point Pattern ext and was made from the code of Circullar pattern feature from standart library.
    It allows all the pattern options from bult in patterns like body/feature/face and new/add/remoove/intersect.
    To define the transforms you need to select vertex or mate connector as origin and a set of target vertices or MC's.
    Internally for every vertex to vertex transforms the feature keeps global orientation of objects.
    For point to MC or MC to point transforms it keeps global orientation on the point side and orientation defined by MC on the side of MC. For MC to MC transforms it uses local orientation on both sides.
    https://cad.onshape.com/documents/25a0a6dfaa76e64574a5e0db/w/ed2afaf5bd2d12066495dc84/e/a71ff51699ae36f356a38f69



Sign In or Register to comment.