grant_PD Posted November 12, 2010 Share Posted November 12, 2010 I've tried unsuccessfully for a few versions of VW to call things like drawing labels, elevation markers, using the create custom tool menu command. But the tool script always ends up calling a spiral or something. How can I call these tools? Quote Link to comment
Assembly Posted November 13, 2010 Share Posted November 13, 2010 (edited) Try using CreateCustomObject and SetRField. Look them up in the function ref. Below is a list of the fields you can set for drawing Label. Couple of pointers. You have to pass a string to SetRField so if you are using a Number variable to pass you need to use Num2String when you set the record. Be careful when you pass a value to a pop up in the PIO. If you send a value that is not defined already it can cause problems. ObjectName:='Drawing Label' HObject:= CreateCustomObjectN(ObjectName,0,0,0,False); SetRField(HObject,ObjectName,'Title',Title); SetRField(HObject,ObjectName,'Drawing',Drawing); SetRField(HObject,ObjectName,'Sheet',Sheet); SetRField(HObject,ObjectName,'Num Config',Num Config); SetRField(HObject,ObjectName,'fScale Config',fScale Config); SetRField(HObject,ObjectName,'Custom Scale',Custom Scale); SetRField(HObject,ObjectName,'ArchScale',ArchScale); SetRField(HObject,ObjectName,'fConfig',fConfig); SetRField(HObject,ObjectName,'WideBubble',WideBubble); SetRField(HObject,ObjectName,'TSizeTitle',TSizeTitle); SetRField(HObject,ObjectName,'TSizeScale',TSizeScale); SetRField(HObject,ObjectName,'TSizeItem',TSizeItem); SetRField(HObject,ObjectName,'TSizeSheet',TSizeSheet); SetRField(HObject,ObjectName,'Factor',Factor); SetRField(HObject,ObjectName,'LineMode',LineMode); SetRField(HObject,ObjectName,'Length',Length); SetRField(HObject,ObjectName,'Flip',Flip); SetRField(HObject,ObjectName,'Rule Offset',Rule Offset); SetRField(HObject,ObjectName,'Text Margin',Text Margin); SetRField(HObject,ObjectName,'Scale Margin',Scale Margin); SetRField(HObject,ObjectName,'Refer',Refer); SetRField(HObject,ObjectName,'Scale',Scale); SetRField(HObject,ObjectName,'Config',Config); SetRField(HObject,ObjectName,'Scale Config',Scale Config); SetRField(HObject,ObjectName,'scaleFormat',scaleFormat); SetRField(HObject,ObjectName,'Title Text',Title Text); SetRField(HObject,ObjectName,'Bubble Text',Bubble Text); SetRField(HObject,ObjectName,'Scale Text',Scale Text); SetRField(HObject,ObjectName,'Drawing Text',Drawing Text); SetRField(HObject,ObjectName,'Font1 ID',Font1 ID); ____________ VAR LIST (you will need to deterime what type of VAR these are) Title Drawing Sheet Num Config fScale Config Custom Scale ArchScale fConfig WideBubble TSizeTitle TSizeScale TSizeItem TSizeSheet Factor LineMode Length Flip Rule Offset Text Margin Scale Margin Refer Scale Config Scale Config scaleFormat Title Text Bubble Text Scale Text Drawing Text Font1 ID _____________ Note that with CreateCustomObject the Custom PIO does not get created in the drawing until the script executes. This means that if you try to use something like GetBBox(hObject,x1,y1,x2,y2); it will return X1=0 y1=0 x2=0 Y2=0 Edited November 13, 2010 by Assembly Quote Link to comment
maarten. Posted November 13, 2010 Share Posted November 13, 2010 Maybe i didn't understand the question completely, but why don't you just use Boolean:=CallToolByName('Drawing label'); ? Quote Link to comment
Recommended Posts
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.