sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Boundingbox.width (height, depth) related to global axes?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 323 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      NewOne
      last edited by

      Hello people!
      In atempt to get a component's dimension I used:

      
      ...
      z = bbox.depth
      x = bbox.width
      y = bbox.height
      ...
      
      

      But I've seen that depth, width and height are not related to component's axes, but to global axes!
      see the links: http://bayimg.com/FAlhMaAbk and http://bayimg.com/fAlHoAABk
      Same component, rotated in drawing space returned different dimensions. (see result in Ruby Console)
      I want to get axes-based dimendions of the component (component's axes). If blue is on 50mm edge, I want to have z=50mm, and so on.
      Does somebody have some ideas about how can be this done?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • C Offline
        CPhillips
        last edited by

        Use the bounding box from the definition

        componentinstance.definition.bounds
        

        Note: if your component instance is scaled you will need to scale the bounds the same amount.

        1 Reply Last reply Reply Quote 0
        • N Offline
          NewOne
          last edited by

          @cphillips said:

          Use the bounding box from the definition

          componentinstance.definition.bounds
          

          Note: if your component instance is scaled you will need to scale the bounds the same amount.

          Thanks a lot ! You made my day ☀

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement