WOW ! I just try it right now and it's impressive work !
It's little bit easier to write a code now !
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 !! -
RE: Hole plugin
I made some test on that plugin.
If the entity is longer than ~25000 cm (more than 25400cm, I just test it), you can make any hole. If it's smaller than that value, it workingre-edit2 : I can make a hole in groups ! (many thanks thom !)
Now I still have the first problem... -
RE: Hole plugin
@thomthom said:
I don't understand the rest of your code.
mini = 10000
What is this magic number?current_norm_reverse.length = 1000
What is the purpose of this line?me too, that code is from rectangleHoletool.rb from the link in my first post
-
RE: Hole plugin
I'm gonna read your articles
and test what you tell me to do.
-
RE: Hole plugin
I have an another pb... I can't create hole in components or groups. I have to explode it before make a hole
-
Hole plugin
Hello !
I need some help on a plugin.
I made geometrical form on that cube and I have a plugin which allow you to make hole in there (pushpull method).
When I started with 1,2,3,4 then A it worked.
If I start with a letter then number I have a hole only on A or B, but not in number because the pushpull make a hole on the edge of the cube.Why it worked like that ?
I take the idea from that plugin, but this plugin work only for rectangle form...
http://rhin.crai.archi.fr/rld/plugin_details.php?id=326I modify it to work with one click on the face. (you have to draw the geometrical form first then select the face and it create the hole)
How can I upload to plugin to show you ?
File test of Hole plugin
THX thomthom !To use it, copy it into plugin directory.
Then create a simple cube with geometrical form on that cube.
Click on "Plugins> njeremy2 Hole"
The plugin is activated, select the geometrical form and it create the hole -
RE: Basic operation on char...
For this example I put a tree and a Blue cube.
The tree has no description and the Cube has code reference then the real description after "b755480 BLABLABLA".
Then I create a groupe with the 2 objects called "Tree+cube"Now I export all information with my plugin :
then I export all information in CSV File :
-
RE: Basic operation on char...
@thomthom said:
What is not working right?
Do you have a sample code?When assigning an attribute to the definition the attribute is stored whenever you export - it works fine. But if it doesn't work for you then it's probably something in your code that isn't quite right.
I have nothing at home, tomorrow I'll show you what I need to do with that (with screenshots)
-
RE: Basic operation on char...
@thomthom said:
What if your user accidentally modify the description? Or some other plugin the user has install modifies it?
right...
But I try to use attributes, but I cannot do it right
-
RE: Basic operation on char...
my solution by putting the reference in description work, it isn't good programming but it works lol
thank you thom !
-
RE: Basic operation on char...
yeah ok !
I will try but the result is not guarantee