Flip along for multiple components


#1

Hi, can anyone help - am i missing something obvious.

I have a few thousand components that i want to do ‘flip along components red’ on (the one on the right click menu).

I can select them all with the mouse, but this only offers the flip on the whole selected set.

How do i perform an individual flip on lot of components ? Is there a plugin ?

Kev


#2

If you select multiple components, Flip Along works based on the model axis orientation. If it’s a single component selected, Flip Along is based on the component’s axis orientation. It’s supposed to work that way.

I don’t know of a plugin that would flip each component of a large selection based on its own axes but I imagine it could be written.

Could you make them unique from the ones that aren’t getting flipped? If so, what you want could be done without a plugin.


#3

Hi DaveR, thanks for the response,

i get that its supposed to work that way. My concern was that there was a simple key modifier (like ctrl or something) that would make it work on individual components when multiples are selected and that i didnt know about it.

I do a similar thing with rotation, with a little script like this…

def rotate(axis, angle)
sel = Sketchup.active_model.selection
sel.each { |entity|
o = entity.transformation.origin
tr = Geom::Transformation.rotation(o, axis, angle.degrees)
entity.transform!(tr)
}
end

but i cant get it to work with translating the X by -1.

Kev


#4

Could you maybe rewrite your script to loop through the selection’s entities and scale them each by -1 along local red (or whatever local axis you pick)?


#5

Yeah. There isn’t.


#6

Hi Wo3Dan,

yes, this doesnt work

def flipred()
sel = Sketchup.active_model.selection

sel.each { |entity|
o = entity.transformation.origin

tr = Geom::Transformation.scaling(o, -1,1,1)

entity.transform!(tr)

}
end

i guess i need to work out why,…


#7

You didn’t answer my question. Could you manage with making the components to get flipped unique from those that don’t?


#8

Just looking at that now. I’m exporting the component name, location and rotation of each object to a file for use elsewhere. Ideally i need the component name to be the same.

But i’m going to try what you suggested, then select all and use replace selected instance to replace the modified with the original - which should then be correctly oriented.


#9

That’s a lot of work. Select the ones that need to be flipped and make them unique. They will all be instances of the new component. Open the Component for editing and select all of the geometry. Flip the selection…


#10

Its not, i must have not explained that well.

what you said…

  1. select the ones that need to be flipped and make unique.
  2. open the component, select all, and flip
    now my bit…
  3. set axis of ‘your’ component to be the same orientation as the original
  4. select all instances of your new component
  5. go to component browser, select the original one, select ‘replace selected’

Done ! it worked :slight_smile:

thanks for your help.


#11

Is this what you are looking for? http://extensions.sketchup.com/en/content/eneroth-individual-flip


#12

Excellent! Did you just publish that? I hadn’t seen it before.


#13

Yup, published it some week ago.


#14

You should e-mail me when you do that. :smiley:


#15

:grin: I usually post all my new plugins on Google+ but for some reason I don’t think I did with this plugin.


#16

I see. Keeping it a secret. :smiley:


#17

Looks like it would have been if you’d posted just a few minutes earlier :slight_smile:

Thanks, will try it anyway.

Kev


#18

The three reviews are from 1 month to 2 weeks back. :wink:


#19

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.