Jump to content

Example for vs.AlignDistribute2D(MenuAction, AlignDist2DParms)


DomC

Recommended Posts

Hi

I try to use this Function, but failing by fuguring out the right parameters/variables. I do not understand if i have to get the Variables from an other action/function or if I just missing the right values.

Very nice if anyone could help

Thanks

This is, what the FunctionReference says:

VectorScript Reference.html

PROCEDURE AlignDistribute2D

( MenuAction :LONGINT;

AlignDist2DParms :LONGINT

) ;

Python:

def vs.AlignDistribute2D(MenuAction, AlignDist2DParms):

return None

or here:

Python:

AlignDist2DParms = vs.AlignDistribute2D(MenuAction)

I try to do, something in this direction (Script to Distribute, with a fix offset by expanding the limits):

import vs

links,rechts,unten,oben,xtotal,ytotal=0,0,0,0,0,0 
anzahl=vs.NumSelectedObjects()

# Box auslesen und x, y ausgeben
def xy():
p1,p2=vs.GetBBox(h)
x=abs(p1[0]-p2[0])
y=abs(p1[1]-p2[1])
xmin=p1[0];	xmax=p2[0]; ymin=p1[1]; ymax=p2[1]
return(x,y,xmin,xmax,ymin,ymax)


#vs.AlrtDialog(anzahl)

i=1
h=vs.FSActLayer()	 
while h != None and i <= anzahl:
x,y,xmin,xmax,ymin,ymax=xy()
if links>xmin:
	links=xmin
if rechts		rechts=xmax
if unten>ymin:
	unten=ymin
if oben		oben=ymax
#vs.AlrtDialog(xmin,' ', xmax)
xtotal=xtotal+x
ytotal=ytotal+y
h=vs.NextSObj(h)
i+=1	

rx_abs=links+xtotal
vs.Locus(rx_abs,0)
# vs.AlignDistribute2D(??)  #??????
vs.LNewObj(h)
vs.DelObject(h)

Edited by DomC
Link to comment
  • 3 weeks later...

Hello DomC,

I looked into this: it's a broken procedure (does nothing at best) and is wrongly declared on Dev (actually is wrongly defined in its library). Thank you for pointing this out, I report it now as bug.

Please implement your own procedure using other functions.

Ciao!

orso

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...