hello jorlan,
thanx for the tip.
i corrected it, so the code is clearer (i have to trasport this value to another method, so i assigned an independent variable to ,entity'.)
stan
Posts made by artmusicstudio
-
RE: [solved] a small syntax problem
-
[solved] a small syntax problem
hello,
when i run this code (with 10 faces and NO GROUPS in the selection)
@selection.each { |@entity| if @entity.is_a?(Sketchup;;Face) puts "face" elsif @entity.is_a?(Sketchup;;Group) puts "group" end }
the "face" is printed 10 times and
the "group" is printed 10 timesin the console.what is wrong with my elsif condition?
thanx a lot
stan -
RE: Identifying a group
hi dan,
thanx, ok, again something for my limited brain capacity ( -:) ) ,
what i have to achive is
-iterate thru selection (can be groups, compnents or pure entities and combined)
-check for pure entities in it - at model level (done, works)
-check for pure entities in groups inside ( 1 level deep only, done, works)
+
-check for entities in groups within selected groups ( 1 level deep only)
-check for entities in components within selected groups ( 1 level deep only)
-check for entities in components within selected groups ( 1 level deep only)
-check for entities in components within selected components( 1 level deep only)
so some brainwork is necessary.
we shall see.by the way:
when i iterate thru pure elements within a group, the ruby reads them chronologically, so
newer elements are read out later then the older ones.now, i think of finding a way to iterate depending of the Z height.
is there a way to say directly in the iteration routine, start with lowest elements and go up to the highest?
the result: the found planes would always be numbered from 1 to x like floors !
i still have no idea, how to realise this.
stan
-
RE: Identifying a group
hi jim,
thanx very much.
i understood iterating thru selection-items, which btw. solves also the next step
for the eruby to work onall groups in the selection.
i put this small helper online, when it is finished (have to solve the selection of components , especially nested components in the selected group, to read the items-properties of the planes inside those components.
so thanx, this step works !!!!
stan
-
Identifying a group
hi,
i went thru some topics about it, but i still can't get it:why does this ruby does not identify the group selected?
selection = Sketchup.active_model.selection if selection.is_a?(Sketchup;;Group) puts "selection is a group" selection = group.entities.parent.entities() end
or do i have to go "insode" the group to be able to select the entities?
i my case i don't get the message "selection is a group" at all, when 1 group is selected.
zjanx and ragards
stan -
RE: Ui - messagebox definition
hi jim,
thank you so much. it works. again a step closer to my ruby.
stan -
Ui - messagebox definition
hi,
i cannot find anywhere a solution for making a simple
ui-messagebox with more lines (like a small table)i have
submenu.add_separator submenu.add_separator submenu.add_item("7 support / credits / info"){ UI.messagebox "1.xxxxxxxxx"
but showing
1.xxxxxxxxx
2.xxxxxxxxx
3.xxxxxxxxxand a simpleok-button.
is there a way? in the ruby api they speak about a multiline msgbox, but without showing asyntax.
thanx a lot.
stan -
RE: Changing the height of an edge (line)
hi tig,
thanx for your explanation. too high for me at the moment ( after several trials), but i keep on learning.
i solved the problem by calculation of the bottom side at 0 directly during the creation of the elements.
but one day i will also understand the vertices transormation...
regards
stan -
Changing the height of an edge (line)
hi,
i cannot solve the following task:
if i have , let's a group of faces,
i would like to
-select the edges under a DEFINE HEIGHT (let's assume , all edges are horizontal, so start end end of the edge (line) are both at the same relative height)
-scroll thru the edges
-change the height of start and end of those edges to a new defined height
i don't find my way to it..... (result is : all bottom faces are at the ZERO-PLANE above))
thanx for helping!
stan
-
Need help with textures
hello,
maybe someone has a tip for me, how to redifine the texture on a wall to become a continuous picture thru all polygons (of different width) of the wall.i tried to smooth the wall, apply texture, but again the same result.
does this have something to do with uv-mapping?
thanx very much for for helping.
stan
-
Material-names in dae
hello,
has anybody an idea, why a colour named000000-xxxxx
is renamed to
_000000-xxxxx
in a 3d export - dae-file ?
thanx stan
-
RE: Delete entry from material menu
@jim said:
If you click the Fly-out menu, and select "Remove Collection from Favorites", are you able to remove it?
hi jim,
no, that is the point.
remove collection gives you the selection of collection, which are at the bottom of the pulldown menue.
this one is on the top.....stan
-
Delete entry from material menu
hello,
i have a "weird" link in my material menu ( >> screenshot > the selected one witn "Nürnberg"), which is a link to some fotos on the harddisc, nothing to do with skp at all.
is there a way to delete it?i already made and assigned a new tempate (puge incl. before saving),
but it is still there.as soon as i select "in Modell", it diappears in the actual session.
thanx for helping!stan
-
Mesh - connecting - plugin ??
hello,
does anybody know a plugin, which can connect overlaying meshes by interpolating within the overlay-area,
to get 1 consisten mesh ? ( i have to skooth a large gooegle-earth-import of aboot 30 parts).i tried
Clip_or_Trim_Terrain_Mesh_v1.1.rbz,
but this one seems only to cut the overlayd part of mesh 2.
thanx for helping
stan
-
RE: Stairs Ruby?
@martinrinehart said:
Google didn't help me find the killer stairs Ruby I was looking for. Is there one?
what about this? coming soon.....
regards stan
-
Outdoor stair - ruby preview
hello ruby friends,
there is a small preview of the outdoor-stair-ruby atit is still beta, but the basic functions work now,.....
regards stan
-
RE: Internal numbering of entities differs in iterations?
hi tig,
yes, i understand the principles of giving attributes to entities now and will try to experiment with this.
maybe i may go step back to my special situation (just for understanding):i have an axis of different edges, giving a path for 'followme' ,
then i let create the ruby the same object again and again (imagine:
square, path, followme, delete
square, path, followme, delete
etc.)the funny thing is, that the entities DO have a numbering , which is their position in the array, right?
and so a thought, while knowing , which entity has which number in the row, i could access them easily (again: always the same object with same amount of edges and faces from the same procedure)
but at this point the numbering of faces in the array changes, although generated thru same procedure.
and since the object is a follow-me- object, i cannot give any attributes to single faces, i guess.....
so that's the trouble.
but i can gerate these objects per hand too (face by face), so i will be able to use the 'attribute' option.
regards stan
-
RE: Internal numbering of entities differs in iterations?
hi dan,
ok, so i can give an attribute to an entity.but what can i do , when the same face (let us say the front face of the cube , which is generated by the code again and again), sometimes has a different number in the array ? it is impossible then to know the number and so also not possible to assign attributes.
what ever i do, in my case the number of the face changes (a 3d object crewted by follow me)
hopefully infind the reason, since moving always the same face is an important feature for me.
regards and thanx
stan -
Internal numbering of entities differs in iterations?
hello,
i face a seldom problem:i have always the same polyline created from ruby (say 10 edges, all connected) : curve
then i generate a rectangle at the startin point : square
then i use
status1 = square.followme curve
works perfect.
BUT:
while idenfifying the sidewalls of the result, i found out, that it's entity-number changes from iteration to iteration.
i would not expect that.i checked it by letting the ruby ERASE the entity[16],
which sometimes deleted a different face .
can anybody confirm that?
if so, how is it possible to allocate always the same face of an object generated in a routine?
thanx stan
-
RE: Transformation of single entities ???
hi everybody,
thanx for this interesting discussion,and yes, tig's way worls perfectly, so it is possible to immitate the mouse movement of single entities in any angle and direction.
fantastic!new_line10 = entities31.add_line pts[1], pts[0] tr = Geom;;Transformation.rotation(pts_senkrecht1,@vector,@angle_m.degrees) group31.entities.transform_entities(tr, new_line10) #MOVE 1 FACE >>>> number distance_m_result = @carrier_w *@totaloffset_x_center/@run vector2 = new_line10.line[1] vector2.length = distance_m_result.abs tr = Geom;;Transformation.translation(vector2) group31.entities.transform_entities(tr,group31.entities[number])
stan