Edge length question
-
cface=codef.entities.add_face(@pt) orig_ents = codef.entities.to_a cface.pushpull(-1*@c2depth) if @edge == "Round" fin_ents = codef.entities.to_a added_ents = fin_ents - orig_ents added_ents.each {|e| e.smooth="true" if e.is_a?(Sketchup;;Edge) } added_ents.each {|e| e.soft="true" if e.is_a?(Sketchup;;Edge) } end #if RoundI am using the code to smooth the edges of a Mortise however I don't want to smooth the bottom edges. I have tried several ways to add the test "e.length == @c2depth" but have been unsucessful. Any ideas how to do this??
Keith
-
When you make the new face immediately set
normal=cface.normal
then after you pushpull it to make the hole [and it's 'gone'] and you've checked it's 'round' and you've got the new geoemtry, you can smooth only those new edges that are parallel to the 'normal' thus:
added_ents.each{|e|(e.smooth=true;e.soft=true) if e.is_a?(Sketchup::Edge) and e.line[1].parallel?(normal)}
Note how you can combine the smooth/soft setting into the one test, which halves the processing time.
Note too that it's=true/=falseboolean NOT strings="true"/="false"[which would both returntruebecause they have a value] -
Thanks TIG That was exactly what I needed!!!
Keith
11
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