Is there a way to created a snap on point in A DC and is there an unselecting a DC event


#1

I am creating a CD that has some elements where other object or geometry should snap on. Like anchor points on a certain object and the snap a drawing line onto that.

Like snapping a line to a Square in a flowchart program.
Is this posible?

Is there a way to get an event when a DC is unselected? This DC self or in a Ruby plugin?


#2

probably use both DCs and Ruby, DC to hold data and allow some manual changes, scripts to help place and any other time savers

some ideas,

  • components are inserted at their axis point, a DC can move the geometry position in relation to this axis

  • guide points could be included on a layer that maybe visible in a scene, these points could be dynamic parts, the scene change to show only the functional shape and snap points

  • a ruby script could access the DC folders, after selection and perhaps some attribute change. the script scales and rotate the elements as required rather than trying to use the move/rotate/scale tools
    I use an adaption of the ruby line tool example to place beams as simply as one would draw a line

  • one could set up a DC parent file, where one inserts children, which would automatic move to a known or relative position after a redraw of the parent. The parent file holds the global attributes, so like a ceiling height, then all wall frames default to this height, change the global height then all change.

still thinking…


#3

Good thinking!! Thank you

That give some idea’s!

Like you wrote, using both is the best way, more control. But did hope…

To keep things together, maybe I can add a skp component in the ruby script sub folder and move that under the cursor with every time a new reference ( and keep it saved ) to that DC ( then I need to check with every script action if the reference is still valid, other wise remove the ref if it is not anymore in the clipb ).

Btw, This DC/Ruby script is currently for Utility parts, tanks and other devices. I would love to draw a line from anchor ‘out’ device 1 snapping to anchor ‘in’ on device 2.


#4

This actually requires a plugin as this is not yet a built-in feature.

This is the only one I know of (at this time.):