Replacing edges by components?


#1

Is it possible to replace all basic edges in a selection (also see * and ** below) by instances of one single component that holds say multiple edges running in the same direction?

The replacements should respect the edge’s directions and their individual lengths, to scale these instances accordingly.
So each edge becomes a component instance, local red along the replaced edge and component’s box length equal to the replaced edge’s length due to scaling that component per edge.

(*) this might be the entire model’s basic edges if nothing is selected

(**) The selection might also be inside a group or component when in editing context.

(also posted in SketchUcation forum)


#2

Should be doable, but you won’t be able to form faces…


#3

I wrote that very script for someone long long ago…
It’s in the SCF PluginStore:
http://sketchucation.com/pluginstore?pln=Lines2Components

If you replace edges, then faces which are reliant on those edges will vanish.
The code could easily be tweaked to leave the edges in place, and overlay them with the component-instance…


#4

Thank you Thomas and Tig,

I’ll see if the script does what I am hoping for.

My ultimate goal is to be able to work on any selection of edges, not only the ones along current drawing axes but also the ones that have different values for all three coordinates at both ends, thus “true 3D”. And thereby replace them all by 3D-Polyline with same lengths as the edges, hence the scaling of the component per instance.
Doing this manually, edge by edge is very laborious and silly if a plugin could do the job.
The 3D pPolyline is wrapped in the component with “definition scale 1:1” say 1000mmm in length.

It would allow one to convert chunks of geometry into a visial reference without the ability, nor the hinder of inferencing to it.

Also see this thread in Sketchucation about some options for using such a script:
http://sketchucation.com/forums/viewtopic.php?f=15&t=60655


#5

As in the the 3D Polyline entity you get when using Shift+Freehand Tool?

Or do you mean a welded curve? I didn’t understand the end result here.


#6

Oh wait - you are actually trying to create 3d polylines? But there is no way to create 3d polylines using the Ruby API… Not sure how you’d be able to create such a straight line polyline though…


#7

Yes, that’s the one that I would like to use with a 1000mm 3D Polyline.

I’ll upload a file with some examples of how it could be used.

Converting by hand is tedious but thanks to sdmitch’s plugin it works very well.
What is the tool for anyway. Since it’s so hard to tame/handle these lines with only basic tools?

p.s. but I need some PC to create the model tomorrow. Mine crashed some time ago.


#8

Sorry for the delay Thomas in reply. This is why I asked for an option (Sam’s script) to replace edges by streched components. Attached file with some examples more or less explains what could be done with 3D Polylines.
It’s up to the user to come up with more / better/ (or none if not convenient at all) examples to use the straight 3D Polylines. I included some color samples +/- 1 m in length.
And I do have to thank Sam D. Mitch for his plugin.

GHH 3D-Poly-examples.skp (705.5 KB)


#9

How did you manage to create a straight 3dpolyline?? o_O

I notice that SketchUp has some issues selecting 3dpolylines. I seem to recall a regression a few versions ago…


Changing the color of the axis
#10

With just basic tools, a saved scene with current drawing axes and an undo.
Oh and 3D Polylines do explode into edges.

  • Drag ‘Freehand’ plus [Shift] to create the line.
  • See if it looks like just one segment. If so, good
  • Explode the one segmented line into an edge (menu Edit > somewhere down is the selection > context menu with lots of options)
  • Change axes along the edge, (I did blue along the edge, to “match” Sam’s script) and save a scene with axes!
  • Now undo the conversion to get back the 3D Polyline.

You now have one segment of the horrible line and its axis captured in the scene.

  • Make the line into a component.
  • Scale the component to length, inferencing on an endpoint of a parallel edge, length 1m.
    (you need to make the selection 2D when scaling, Just select some crossing dummy edge with it.)

The perfect length isn’t that important anymore when applying Sam’s script. It stretches components to fit the edges lengths.

Not interfering dashed lines is also possible, just like the centerline in the file.

Copy the component ceveral times, making them all unique, to be able to apply different colors.
Even when model is set to ‘all the same’.