Author Topic: [Script - Plugin] Flatten  (Read 5559 times)

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
[Script - Plugin] Flatten
« on: December 23, 2012, 17:22:01 pm »
Hello,

A new very little VBscript.

It set to 0 the Z coordinate of each selected polyline.

Code: [Select]
' aplatir (flatten)
' set all Z values to 0 in selected polylines

sub main

if view.SelectedEntities.Length > 0 then


for each ent as Entity in view.SelectedEntities

if typeof ent is Polyline
ent.Flatten()
end if

next ent

view.RefreshView()

end if

end sub

++
David
« Last Edit: May 02, 2014, 19:32:37 pm by dh42 »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: [Script - Plugin] Flatten
« Reply #1 on: May 02, 2014, 19:34:09 pm »
Hello,

I just convert my flatten script to a plugin.

I appears in the Edit/polyline menu (main menu)

++
David
« Last Edit: January 05, 2016, 15:45:17 pm by dh42 »

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1345
    • View Profile
Re: [Script - Plugin] Flatten
« Reply #2 on: May 02, 2014, 22:56:47 pm »
Thanks David the plugin works nice, Your effort is appreciated.
Dave.

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: [Script - Plugin] Flatten
« Reply #3 on: May 01, 2016, 20:08:17 pm »
Hello,

New version 2.0 of the plugin.

Now it works on all 2D objects (except splines) and it can also flatten the points in a point list as for a polyline, it also move the other 2D objects to Z = 0.

undo is also now supported on this version

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/flatten.html

++
David

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: [Script - Plugin] Flatten
« Reply #4 on: May 02, 2016, 16:48:46 pm »
Re

And the source code (VB .net)

++
David