Hello everybody, I have created a tool command and call it up via an icon button. I have the problem that I first have to click in the drawing area before I can work with the actual command. What did I do wrong?
Choose_Standard='Freudig_2'
c= 'Bemaßung'
tsize=10
import vs;
def CustTool():
Result = vs.SetDefaultBeginningMarker(0, 15, 0.118103, 0.000000, 34, 0.050000, False);
Result = vs.SetDefaultEndMarker(0, 15, 0.118103, 0.000000, 34, 0.050000, False);
vs.PenSize(14);
vs.PenBack(256);
vs.PenFore(1271);
Name = '';
if vs.Name2Index(Name) > 0:
vs.PenPatN(-vs.Name2Index(Name));
CustTool();
Dim_Std = {} #Dictionary of Name and Index Number
i=0;v=''
while v !=1:
try:
vs.SetDimStd(i)
except:
pass
vs.LinearDim((0,0), (0,0), 0, 0, 0, 0, 0)
h=vs.LNewObj()
v=vs.GetObjectVariableInt(h,0) #if 1 the function switched to 1 because of an error
n=vs.GetObjectVariableString(h,27)
vs.DelObject(h)
i=i-1
if v !=1:
Dim_Std[n] = v
vs.NameClass(c);
vs.SetDimStd (Dim_Std.get(Choose_Standard));
vs.SetPref(44,True);
vs.SetTool(-211);
vs.TextSize(tsize)