Skip to content

Instantly share code, notes, and snippets.

@ghiboz
Created April 9, 2015 14:09
Show Gist options
  • Save ghiboz/005d72b6eec3a75bc000 to your computer and use it in GitHub Desktop.
Save ghiboz/005d72b6eec3a75bc000 to your computer and use it in GitHub Desktop.
ExportSpline
macroScript ExportSpline category:"ghiboz"
(
for o in selection do
(
nS = numSplines o
print ("num total splines:" +nS as string )
nK = numKnots o
print ("num total knots:" + nK as string )
din_ce = getsavefilename types:"xml|*.xml"
if (din_ce != "") or (din_ce != undefined) do
(
fisier = createfile din_ce
format "<xml>\n" to:fisier
for s = 1 to (numSplines o) do
(
for k = 1 to (numKnots o s) do
(
knt = getKnotPoint o s k
--format "\t<P pos=\"% % %\" />\n" (knt.x as string) (knt.y as string) (knt.z as string) to:fisier
row = ("\t<P pos=\"" + knt.x as string + " " + knt.y as string + " " + knt.z as string + "\" />\n")
print row
format row to:fisier
)--end k loop
)--end s loop
format "</xml>\n" to:fisier
close fisier
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment