Create a new line
-
Does the code create a new line next to a existing line?
model = Sketchup.active_model
entities = model.active_entities
pts = []
pts[0] = [0, 0, 0]
pts[1] = [x, 0, 0]
pts[2] = [x, y, 0]
pts[3] = [0, y, 0]Add the face to the entities in the model
face = entities.add_face pts
I just happen to know that the second and third entities in the
entities objects are edges.
entity1 = entities[1]
entity2 = entities[2]
edges = entity1.all_connected
if (edges)
UI.messagebox edges.to_s
else
UI.messagebox "Failure"
end -
No, it creates a rectangel on the xy plane.
-
You're making it too complex...
pt0=[0,0,0]
pt1=[1,0,0]
Sketchup.active_model.active_entities.add_line(pt0,pt1)
Adds a new line from the origin 1" long, to the right [i.e. X/red axis]
The entities.add_... methods are listed in the API guides and cover many aspects of adding lines, arcs, circles, polygons, clines, cpoints, faces, text etc... please read them and have a mess around...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement