WOW ! I just try it right now and it's impressive work !
It's little bit easier to write a code now !
Latest posts made by njeremy2
-
RE: Notepad++ SU8 Ruby API Autocomplete
-
RE: Integration tool by using paste in place
oh ok!
Thanks to all ! I understand now -
RE: Integration tool by using paste in place
Oh wooow! thank you TIG !
It works great ! you are fabulous !
When I look the code, it's different than what I tought !
Just a little question, if you initialise "@group=nil" is it the same if you do that : "@group=[]" ?
Because after picking, you put each group you found inside "@group".Voila ! thank you so much
-
RE: Integration tool by using paste in place
Here is my file,
When I test it, I select my drawing which I want to add in group.
Then this plugin create group with that drawing put it cannot execute the next line (with transform)I didn't test it in RUBY console into sketchup
file reupload at 11h49 - France
-
RE: Integration tool by using paste in place
@tig said:
What error messages do you get ?
Any group/instance has a transformation.
We use it here to get the temp group into the group in the same relationships ...There is no error messages but this line isn't executed.
%(#BF0000)[model = Sketchup.active_model
things = model.selection.to_a
UI.messagebox "initialization ok"tempgroup=model.active_entities.add_group(things) UI.messagebox "add group ok" inst=group.entities.add_instance(tempgroup.entities.parent, tempgroup.transformation*(group.transformation.inverse)) UI.messagebox "add_instance ok"]
I put messageBox each line to see if the code is executed or not.
"add instance ok" didn't appear so I guess is not workingInto outliner, I see the plugin create a new group for my thing which is selected but it isn't integrated inside the initial group.
-
RE: Integration tool by using paste in place
this line doesn't work :
inst=group.entities.add_instance(tempgroup.entities.parent, tempgroup.transformation*(group.transformation.inverse))
What "transformation" module is use for ?
Because in "Automatic Sketchup.pdf" transformation* doesn't exist.
It's write : The transformation method is used to retrieve the transformation for the group.
But what transformation ?I'm stuck here, I'm coming back tomorrow
-
RE: Integration tool by using paste in place
@thomthom said:
You can use the PickHelper to determine you are drawing on a face inside a group and then draw directly inside that group.
Yes you can do that but my boss tell me that someone forget to go inside the group before drawing, that's why he asks me to do this plugin ...
... we have stupid sketchup users in france
-
RE: Integration tool by using paste in place
@thomthom said:
You can use the PickHelper to determine you are drawing on a face inside a group and then draw directly inside that group.
@njeremy2 said:
I just start to write the structure of code. I made research for "send_action" for cutting and paste my drawing
Your approach seem to be translating directly what you do in SketchUp - by copying and pasting. But with when using the Ruby API there are usually other (and better) ways to do thing. (Remember, when you want to make a grouped box when using SketchUp UI you draw the cube then group it - with the API you create the group and draw directly into the group - different approach.)
What I don't understand is why you want to do this... you want to avoid opening/closing the groups?
I avoid nothing, I haven't got a special way to do that but I don't know how to start the plugin
So if understand well, Tig advise me to get the selection and put it into temporary group.
Then put this tempgroup into the existing "GROUP1" ? then explode GROUP1 and erase tempgroup ?At the end, there is no group if I explode GROUP1 ? (is it what you said ? I think I don't understand lol )
Anyway, if the tempgroup is into GROUP1 with your solution it's good for me !
I will try this now !
-
Integration tool by using paste in place
Hello everybody !
I'm starting to write a new plugin : Integration tool
This plugin is used to integrate a draw into a group.Before this plugin when I want to integrate a draw into the group, I select it, I cut it, I select my group where I want to put it and then I select "paste in place".
With that plugin, I want to automatise that.
Here some screenshots of what I need to do.
How should work my plugin :
-I select the drawing I want to add
-I start/activate the plugin
-A messageBox comming : "Select the group where you want to integrate"
-I select the group
-The drawing is inside the group !I just start to write the structure of code. I made research for "send_action" for cutting and paste my drawing
https://developers.google.com/sketchup/docs/ourdoc/sketchup#send_actionCan I use "onLButtonDown" for selecting my group when the drawing is selected ?
Can you help me to give me some leads to reach this objective ?
-
RE: Hole plugin
ahahah
AHAHAHAHAHA !!! Thank you thomthom !!It works great !!!
Many many many .... (ctrl+C, ctrl+V) ... many thanks !!