Jump to content

vs.CallTool SP3


Recommended Posts

That little test works here. It seems the nested callback of the wiki-example is a little bit too ambitious.
 

vs.DSelectAll()

def resultCallback1():
	h1 = vs.FSActLayer()
	vs.DSelectAll()
	p1 = vs.GetSegPt1(h1)
	p2 = vs.GetSegPt2(h1)
	vs.Locus(p1)
	vs.Locus(p2)
vs.CallTool(-201, resultCallback1)

 

Link to comment

Hello,

 

i tried to use this in a tool. Unfortunately i found this function to be inconsistent at least when used in a tool that is called by a click.

After i selected the tool, sometimes the first click on the drawing (i assume this is the click that runs the code) is the first point of the line, and sometimes i need another click on the drawing to start the line.

 

In your example this is not too bad, because the vs.CallTool() function is called right at the start of the script. But i wanted the first click on the drawing to just open an UI and than call the vs.CallTool() according to the mode that had been chosen in the UI.

 

I also tried to call the vs.CallTool() function two times in a row, but i always crashed vectorworks.

  • Like 1
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...