CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 21, 2020, 20:32:58 pm


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: changing sizes on multiple oblects  (Read 7086 times)
EAC
Storm Trooper
***
Offline Offline

Posts: 179



View Profile WWW
« on: June 21, 2012, 15: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 Smiley

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
Logged

lloydsp
CNC Jedi
*****
Offline Offline

Posts: 8109



View Profile
« Reply #1 on: June 21, 2012, 16: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
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
EAC
Storm Trooper
***
Offline Offline

Posts: 179



View Profile WWW
« Reply #2 on: June 21, 2012, 21:02:05 pm »

They are circles which are poly lines, not circles per say, so there is no diameter property.

Don
Logged

10bulls
Administrator
CNC Jedi
*****
Offline Offline

Posts: 2133


Coding Jedi


View Profile WWW
« Reply #3 on: June 21, 2012, 21:21:42 pm »

Scripts to the rescue!  Grin

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:
# 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!

Logged
lloydsp
CNC Jedi
*****
Offline Offline

Posts: 8109



View Profile
« Reply #4 on: June 21, 2012, 21:42:44 pm »

Andy, I'm not familiar with Python, but there's no "next" or "end if" in that script!

LLoyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
10bulls
Administrator
CNC Jedi
*****
Offline Offline

Posts: 2133


Coding Jedi


View Profile WWW
« Reply #5 on: June 21, 2012, 22: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.  Roll Eyes

Logged
EAC
Storm Trooper
***
Offline Offline

Posts: 179



View Profile WWW
« Reply #6 on: June 21, 2012, 23:07:31 pm »

As I said, if any software could do it, it would be CamBam!!! 

It works perfectly  Smiley Smiley Smiley

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

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

Thanks a LOT

Don @ EAC

Scripts to the rescue!  Grin

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:
# 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!


Logged

lloydsp
CNC Jedi
*****
Offline Offline

Posts: 8109



View Profile
« Reply #7 on: June 21, 2012, 23: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
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
10bulls
Administrator
CNC Jedi
*****
Offline Offline

Posts: 2133


Coding Jedi


View Profile WWW
« Reply #8 on: June 22, 2012, 00:04:58 am »

By the way  Wink  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.  Sad

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?



Logged
EAC
Storm Trooper
***
Offline Offline

Posts: 179



View Profile WWW
« Reply #9 on: June 22, 2012, 00:24:21 am »

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  Wink  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.  Sad

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?




Logged

dh42
Administrator
CNC Jedi
*****
Online Online

Posts: 5727



View Profile WWW
« Reply #10 on: June 23, 2012, 20:22:08 pm »

Hello Andy,

Thanks for this script  Wink

++
David
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.131 seconds with 20 queries.

Copyright © 2018 HexRay Ltd. | Sitemap