Author Topic: changing sizes on multiple oblects  (Read 7526 times)

Offline EAC

  • Storm Trooper
  • ***
  • Posts: 179
    • View Profile
    • Eureka Airctraft
changing sizes on multiple oblects
« on: June 21, 2012, 14:46:18 pm »
I never work in the CAD side of CB...

Is there a way to change the size of multiple objects at once, without changing center points, such as changing the size of several circles without changing their locations.

I'm hoping CB has a way, I can't find anything else that will do it. Andy seems to work magic :)

Part 2 of importing the point list.  If you export the file after importing the point list, it makes .02" circles, not points, which is good.  I am trying to make the circles bigger, without changing the locations..

Don

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8314
    • View Profile
Re: changing sizes on multiple oblects
« Reply #1 on: June 21, 2012, 15:03:43 pm »
Don,
If all the circles are the same size, you can change them all to a new diameter (all the same) very simply.

Just select all the circles.  Then modify only the diameter property in the properties pane at the left.  They will all instantly change to the new size.

The properties pane will grey-out any properties that are not the same among many objects, but will show you the properties that are identical.  You can modify any of them, but at least you have a visual cue as to which properties are the same and can be changed at once.

LLoyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline EAC

  • Storm Trooper
  • ***
  • Posts: 179
    • View Profile
    • Eureka Airctraft
Re: changing sizes on multiple oblects
« Reply #2 on: June 21, 2012, 20:02:05 pm »
They are circles which are poly lines, not circles per say, so there is no diameter property.

Don

Offline 10bulls

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 2164
  • Coding Jedi
    • View Profile
    • www.cambam.info
Re: changing sizes on multiple oblects
« Reply #3 on: June 21, 2012, 20:21:42 pm »
Scripts to the rescue!  ;D

This is Python code, so use 'Script - New - Python Script', paste the following text, select what drawing objects you want to resize, click within the script text and press F5.

Code: [Select]
# In Place Resize
scale=0.5

if view.SelectedEntities.Length > 0:
    for ent in view.SelectedEntities:
        cp = ent.GetCentroid()
        ent.Transform.Translate(-cp.X,-cp.Y,-cp.Z)
        ent.Transform.Scale(scale,scale,scale)
        ent.Transform.Translate(cp.X,cp.Y,cp.Z)

Oh, and change the scale=? line to whatever scale factor you need.

I hope this is what you were after!


Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8314
    • View Profile
Re: changing sizes on multiple oblects
« Reply #4 on: June 21, 2012, 20:42:44 pm »
Andy, I'm not familiar with Python, but there's no "next" or "end if" in that script!

LLoyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline 10bulls

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 2164
  • Coding Jedi
    • View Profile
    • www.cambam.info
Re: changing sizes on multiple oblects
« Reply #5 on: June 21, 2012, 21:38:14 pm »
Andy, I'm not familiar with Python, but there's no "next" or "end if" in that script!

In python, the indentation (white space), is actually part of the syntax... so no 'next' or 'end ifs' needed.
Apparently this is supposed to reduce redundant text, enforce indentation and keep things more readable.  ::)


Offline EAC

  • Storm Trooper
  • ***
  • Posts: 179
    • View Profile
    • Eureka Airctraft
Re: changing sizes on multiple oblects
« Reply #6 on: June 21, 2012, 22:07:31 pm »
As I said, if any software could do it, it would be CamBam!!! 

It works perfectly  :) :) :)

Andy, you are the king of the lab...  Where else do you get this kind of support?

By the way  ;)  Any word on 'use this style for inside cuts' MOP property yet?

Thanks a LOT

Don @ EAC

Scripts to the rescue!  ;D

This is Python code, so use 'Script - New - Python Script', paste the following text, select what drawing objects you want to resize, click within the script text and press F5.

Code: [Select]
# In Place Resize
scale=0.5

if view.SelectedEntities.Length > 0:
    for ent in view.SelectedEntities:
        cp = ent.GetCentroid()
        ent.Transform.Translate(-cp.X,-cp.Y,-cp.Z)
        ent.Transform.Scale(scale,scale,scale)
        ent.Transform.Translate(cp.X,cp.Y,cp.Z)

Oh, and change the scale=? line to whatever scale factor you need.

I hope this is what you were after!



Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8314
    • View Profile
Re: changing sizes on multiple oblects
« Reply #7 on: June 21, 2012, 22:10:09 pm »
Thanks, Andy!

I have to remember to close "for" and "next" and "while" statements.  And I fully appreciate and use indentation -- so this is an improvement!

LLoyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline 10bulls

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 2164
  • Coding Jedi
    • View Profile
    • www.cambam.info
Re: changing sizes on multiple oblects
« Reply #8 on: June 21, 2012, 23:04:58 pm »
By the way  ;)  Any word on 'use this style for inside cuts' MOP property yet?
Sorry Don, I have been meaning to get back to you on that one.
I have been looking into this, but it's not as straight forward as it first sounds.  :(

Cutting a long story short, it turns out to be rather tricky to split out using 'style A' properties for outside shapes and 'style B' properties for inside shapes.  Particularly with things like holding tabs, which are applied toward the end of toolpath generation when individual paths may have been combined.

So I was thinking it may be better to tackle the specific problem, rather than trying to come up with a generic solution (that it turns out would add a lot more complexity).

How about then, for holding tabs, we just add an extra option for when to use (automatic) tabs.
For example, a drop down property:
Auto Tab Usage : Inside and Outside | Outside Only | Inside Only

The inside outside would be determined at the end of toolpath generation, not necessarily from the source shape.
For example, if you have a 'C' shape object, the toolpath for this can result in an outside and inside toolpath (if the tool is too wide to fit between the horns of the 'C' )

Plan B would be to introduce a method where you could easily select inside shapes only or outside shapes only, then use two different MOPs for each.
This may be less efficient with regard to toolpath optimisation but gives you the flexibility to machine both sides
completely differently.

Any good?




Offline EAC

  • Storm Trooper
  • ***
  • Posts: 179
    • View Profile
    • Eureka Airctraft
Re: changing sizes on multiple oblects
« Reply #9 on: June 21, 2012, 23:24:21 pm »
Since Tabs are the main issue, your solution should work fine...I figured if it was easy, you would have already done it...

I did find a caveat when using the script.  Be sure to apply any transformations before you run it....

Thanks,

Don

By the way  ;)  Any word on 'use this style for inside cuts' MOP property yet?
Sorry Don, I have been meaning to get back to you on that one.
I have been looking into this, but it's not as straight forward as it first sounds.  :(

Cutting a long story short, it turns out to be rather tricky to split out using 'style A' properties for outside shapes and 'style B' properties for inside shapes.  Particularly with things like holding tabs, which are applied toward the end of toolpath generation when individual paths may have been combined.

So I was thinking it may be better to tackle the specific problem, rather than trying to come up with a generic solution (that it turns out would add a lot more complexity).

How about then, for holding tabs, we just add an extra option for when to use (automatic) tabs.
For example, a drop down property:
Auto Tab Usage : Inside and Outside | Outside Only | Inside Only

The inside outside would be determined at the end of toolpath generation, not necessarily from the source shape.
For example, if you have a 'C' shape object, the toolpath for this can result in an outside and inside toolpath (if the tool is too wide to fit between the horns of the 'C' )

Plan B would be to introduce a method where you could easily select inside shapes only or outside shapes only, then use two different MOPs for each.
This may be less efficient with regard to toolpath optimisation but gives you the flexibility to machine both sides
completely differently.

Any good?





Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6052
    • View Profile
    • Cambam V1.0 French Doc
Re: changing sizes on multiple oblects
« Reply #10 on: June 23, 2012, 19:22:08 pm »
Hello Andy,

Thanks for this script  ;)

++
David