Gaieus,
I thank you for your advice. I resolved the problem by defining a new style and setting the line profiles to 1 pixel.
Greg
Gaieus,
I thank you for your advice. I resolved the problem by defining a new style and setting the line profiles to 1 pixel.
Greg
Thanks Jim and tomsdesk. Unchecking 'Display Edges' does not do it because I'm using lines to simulate empty bins in a virtual warehouse, but setting the line profile from 3 to 1 does the trick.
I'm trying to derive the Ruby commands to do this programmatically.
Greg
Hello,
The syntax for obtaining style information is listed as follows:
%(#FF0080)[styles = model.styles
style = styles.active_style]
But I can't find any documentation on setting the style and, more importantly, changing the edge profile from the default of 3px to 1px. Can this be done?
Thank you.
Greg
Hello,
I resolved the problem of the blurry text by doing the following:
Open the styles window (Select Window >> Styles).
Select the edit tab in the styles window.
Change the value in the Profiles field from it's default value of 3 to a value of 1.
The blurriness is eliminated from the 3D Text. It also makes the lines that define the objects thinner, which in my case, makes the drawings more elegant.
My question is: How can I do this programmatically? What are the Ruby commands to ...
Set the Profiles value from 3 to 1.
Set the style to 'canvas.'
Thank you.
Greg
Hello,
I thought this would be easy, but I don't see how to make the lines in the objects thin. They are thin when I move the object, but as soon as the object stops the lines change to thick, like going from pen to magic marker.
Is there a way to make and keep the lines thin?
Thank you.
Greg
Gaieus,
Thanks for your guidance. However I am unable to minimize the blurriness of the text. As a simple test, I executed the following steps:
I selected the 3d Text tool (Tools >> 3d Text) and attached the text to a rectangular cube.
I then changed the face style to Wireframe (View >> Face style >> Wireframe)
I hid all of the edges of the cube by clicking on each edge and selecting 'Hide.'
However, the 3d Text is still blurry. I'm doing something wrong. How do you navigate to the 'Context' of an object or limit the wireframe option to a specific object? The Wireframe option does not seem to effect the 3D Text.
Greg
Hello,
Is there a way to eliminate or minimize the blurriness of 3D-Text? It is very clear and sharp when you move the object around, but changes to dark and blury once the object is still.
It also prints blurry. I'm using Arial Narrow. Is there a suggested font for 3D text?
Thank you.
Greg
Thanks TIG, I'll add this code and evaluate.
Greg
Hello,
Is there a way to pass a parameter to .exe file run by the openURL?
For example the following code works:
%(#FF0080)[dict_key_url="c://gfTest01.exe"
UI.openURL(dict_key_url)]
But it does not work when I add a parameter:
%(#FF0080)[dict_key_url="c://gfTest01.exe?x=123"
UI.openURL(dict_key_url)]
Thank you.
Greg
Right, I had too much code. This works:
%(#FF0080)[# front plane
pt1 = Geom::Point3d.new(x,y,z)
pt2 = Geom::Point3d.new(x+w,y,z)
pt3 = Geom::Point3d.new(x+w,y,z+h)
pt4 = Geom::Point3d.new(x,y,z+h)
edges[0] = entities.add_line(pt1, pt2)
edges[1] = entities.add_line(pt2, pt3)
edges[2] = entities.add_line(pt3, pt4)
edges[3] = entities.add_line(pt4, pt1)
face = entities.add_face edges
face.material = m
dict_name="link_data"
dict_key_url="http://www.inventoryPalletDetailTest.com"
face.attribute_dictionary(dict_name, true)
face.set_attribute(dict_name,"url",dict_key_url)
Thanks Jim.
Greg
Hello,
I'm getting the following error when I attempt to add an attribute:
Error: #<NoMethodError: undefined method `attribute_dictionary' for nil:NilClass>
Here is the code snippet:
%(#8000FF)[# test code start
model=Sketchup.active_model
e = model.selection[0]
dict_name="link_data"
dict_key_url="http://www.inventoryPalletDetailTest.com"
e.attribute_dictionary(dict_name, true)
e.set_attribute(dict_name,"url",dict_key_url)
What is the syntax for defining attribute methods?
Thank you.
Greg
Thanks TIG,
I'll look at that now.
Greg
Hello,
Is there a way to add a hyperlink to an object that launches another ruby plug-in?
If not, is there a way to add a hyperlink to an object in general? Is so, how is such a hyperlink used?
Thank you.
Greg
Thanks TIG,
I'll apply your suggestions and evaluate the results.
Greg
TIG,
Thanks for your help. The following code 'status = grpEnts.transform_entities t, grpEnts.collect' rotates the 3D-Text:
txtPt = Geom::Point3d.new(x+w,y,z+(h/2))
t=Geom::Transformation.new(txtPt)
grp=entities.add_group(); grpEnts=grp.entities
grpEnts.add_3d_text("hey mon", 1, "Verdana", false, false, 4.inch, 1.mm, 0, false, 0)
grp.move!(t)
t = Geom::Transformation.rotation(txtPt,[1,0,0],90.degrees)
status = grpEnts.transform_entities t, grpEnts.collect
This was copied from ldraw.rb.
Greg
TIG,
I have tried variations of the code but I can't get it to work.
%(#FF0040)[txtPt = Geom::Point3d.new(x+w,y,z+(h/2))
t=Geom::Transformation.new(txtPt)
grp=entities.add_group(); grpEnts=grp.entities
grpEnts.add_3d_text("hey mon", 1, "Verdana", false, false, 4.inch, 1.mm, 0, false, 0)
grp.move!(t)
grp = Geom::Transformation.rotation(txtPt,[0,0,1],90.degrees) # these are variations
txtPt = Geom::Transformation.rotation(txtPt,[0,0,1],90.degrees) # these are variations
t = Geom::Transformation.rotation(txtPt,[0,0,1],90.degrees) # these are variations
rotate = Geom::Transformation.rotation(grp,[0,0,1],90.degrees) # these are variations]
I don't understand the relationship of 'Geom::Transformation.rotation(point,vector,angle)' to grpEnts.add_3d_text.
What am I overlooking?
Thank you.
Greg
Thanks TIG,
I actually used your code as a guide to get as far as you see here. But I don't see how to programmatically snap the 3dtext to the front and side of a cubed-shaped object (pallet) without user intervention. I need the application to snap the text to the pallet automatically.
Is this the section of your code I should reference for the 'snapto' functionality?
%(#FF0040)[compo.behavior.always_face_camera=true if @cfacing=="Yes" ### faces camera
if @asnap=="Yes"
compo.behavior.is2d=true
compo.behavior.snapto=0 ### snaps to Any surface
end#if
tag=model.place_component(compo)]
If so, I can't figure out the relationship between your compo (components) and my grpEnts (entities).
Greg
Just a follow-up to clarify my question: How do I set the (x,y,z) coordinates of the text to control it's orientation?
I am programmatically assigning 3dtext as pallet labels to the front and top of pallets in a virtual warehouse created from ruby code generated from a c# application accessing inventory data from a SQL database, 2 to 3 thousand pallets.
Right now, the text just lays flat on an x,y plane. That works for printing text on the top of pallets, but I can't orient the text upright so that it properly prints on the front of pallets.
I hope this makes sense.
Thank you.
Greg
Done means I moved the posting to this forum, Ruby Discussions, from the 'Newbie' forum. Actually, I copied this from the 'Newbie' forum to this forum, 'Ruby Discussions'. I don't know how to move a posting.
Is there a more appropriate forum then 'Ruby Discussions'?