jamdu Posted February 24, 2023 Share Posted February 24, 2023 Is there a tool or script that would allow one to select an existing text object and convert it to a callout object easily? Ideally this would be one step - without having to go into the text object select the text and then paste it into a callout. Quote Link to comment
michaelk Posted February 25, 2023 Share Posted February 25, 2023 There is now. That is a great idea. And a command that I would use often. Here's a first pass at it text to callout.vwx 2 Quote Link to comment
michaelk Posted February 25, 2023 Share Posted February 25, 2023 @jamdu Let me know what you think of this script. I think it needs a few tweaks. It should use the justification of the original text It should use the font, size, and formatting of the first character. You can't change formatting within a callout. Either every character is in italics or none are. Right now it's destructive. The original text objects gets deleted. I think that's the right way to go, but I'm not sure. Currently the callout is being placed at the text object center. Should there be associated clicks to place the callout target, but try to keep the text in the same place? The callout description should be the first whatever it is -42?- characters of the original text. I doesn't really handle text that is on 3D planes very well. Not sure how to fix that. The script posted above has a debugging message that I accidentally left on. This one doesn't. text to callout.vwx 2 Quote Link to comment
Pat Stanford Posted February 25, 2023 Share Posted February 25, 2023 Here is a very basic script that takes the currently selected text block and makes a Callout located at the Top Left corner of the text block bounding box. Extremely lightly test. Use at your own risk. It deletes the text box after it makes the callout. Good Luck. I don't have time to make the many, many, many modifications that would make this more useful (calculate correct location, rotated text, set Callout properties, etc.) but I many offer suggestions. Procedure TextToCallout; {©2023 Pat Stanford - pat@coviana.com} {licensed under the Boost Software License 1.0} {https://github.com/boostorg/boost/blob/master/LICENSE_1_0.txt} {TL/DR Use as you want, attribution for source, No warranty} {Example of making a Callout object from a text block.} {Very untested. Use with caution. Here by Dragons.} VAR H1,H2 :Handle; X1,Y1,X2,Y2 :Real; S1 :String; BEGIN H1:=FSActLayer; If GetType(H1)=10 THEN BEGIN S1:=GetText(H1); GetBBox(H1, X1,Y1,X2,Y2); H2:=CreateCustomObject('Callout',X1,Y1,0); SetRField(H2, 'Callout','Text',S1); DelObject(H1); End; End; Run(TextToCallout); 1 Quote Link to comment
Pat Stanford Posted February 25, 2023 Share Posted February 25, 2023 I had this written but failed to hit send. So even though Michaels is better, her is the guts. 1 Quote Link to comment
jamdu Posted February 25, 2023 Author Share Posted February 25, 2023 I tried Michael's out and it works like a charm! Thanks MichaelK and Pat! Quote Link to comment
michaelk Posted February 25, 2023 Share Posted February 25, 2023 @Pat Stanford I think ours are essentially the same. Except I wasn't smart enough to think of using the bounding box. 🙂 Quote Link to comment
jamdu Posted February 25, 2023 Author Share Posted February 25, 2023 Hey Michael - Looks like the horizontal text alignment is always defaulting to "center" instead of taking on the alignment of the original text. I tried messing with the script a little but I'm a scripting novice so didn't get too far. Any suggestions? Quote Link to comment
michaelk Posted February 25, 2023 Share Posted February 25, 2023 working on it! I actually manually put in a bunch of values to see if this was even possible. So this script will always make callouts that are centered, plain text, Arial font, etc. Depending on how things shake out this weekend, I might have it really soon. Or Pat will fix it for me 🙂 Quote Link to comment
Elite Exhibits Posted February 27, 2023 Share Posted February 27, 2023 Suggestion As Pat does - put the text of the script into the message VWX files are great - Except for those who run slightly older versions Something (...as we do) while awaiting for SP's to be posted and the new VW/RW bugs are worked out. Thanks You Much Peter Quote Link to comment
FKA Posted February 28, 2023 Share Posted February 28, 2023 (edited) Hey there, that's exactly what I was looking for;)🤗 But...;)There is always a "but"...🙈 Is it possible to make the script work with multiple text objects at once? My Problem is, that I have a plan with lots of text objects that I would like to get all of them in a worksheet...a callout could do the Job. Thanks in advance Flo OK, I managed to edit it by myself;) I added a procedure TXTtoCALL and ForEachObject(TXTtoCALL,((SEL=TRUE) & (T=TEXT))); Edited February 28, 2023 by FKA 2 Quote Link to comment
joestewart4669 Posted August 22, 2023 Share Posted August 22, 2023 Hi, Am I using the wonderful script you sent correctly as it doesn't seem to work in VP annotations? Many thanks Joe Quote Link to comment
michaelk Posted August 22, 2023 Share Posted August 22, 2023 @joestewart4669 I haven't looked, but I bet it also doesn't work inside of groups. I'll fix that when I get a chance. Quote Link to comment
michaelk Posted August 22, 2023 Share Posted August 22, 2023 @joestewart4669 this should fix it. text to callout 2.vwx PROCEDURE Test; VAR hCallout,hText,Waldo : HANDLE; s1 : DYNARRAY[] of CHAR; fakeName : STRING; objType : INTEGER; xx,yy,zz : REAL; BEGIN; Locus(0,0); Waldo := LNewObj; hText := PrevSObj(Waldo); DelObject(Waldo); HCenter(hText,xx,yy); fakeName := Date(2,1); SetName(hText,fakeName); objType := ObjectType(N = fakeName); IF objType = 10 THEN BEGIN {AlrtDialog(CONCAT('Objecty Type: ',objtype));} s1 := GetText(hText); {AlrtDialog(s1);} hCallout := CreateCustomObject('Callout',0",0",#0.0000000000000d); Record(LNewObj,'Callout'); SetRField(LNewObj,'Callout','Link To Database','False'); SetRField(LNewObj,'Callout','Place As Keynote','False'); SetRField(LNewObj,'Callout','Keynote Prefix',''); SetRField(LNewObj,'Callout','Keynote Suffix',''); SetRField(LNewObj,'Callout','BubbWidth','2"'); SetRField(LNewObj,'Callout','Vertical Placement','Auto'); SetRField(LNewObj,'Callout','Orientation','Auto'); SetRField(LNewObj,'Callout','Left','False'); SetRField(LNewObj,'Callout','Bubble Style','None'); SetRField(LNewObj,'Callout','Radius Factor','0.046850393700787"'); SetRField(LNewObj,'Callout','Margin','0.046850393700787"'); SetRField(LNewObj,'Callout','Bubble Shadow','False'); SetRField(LNewObj,'Callout','Shoulder','1''0.000000000000002"'); SetRField(LNewObj,'Callout','Leader Type','Straight'); SetRField(LNewObj,'Callout','Leader Style','Line'); SetRField(LNewObj,'Callout','LineLength','3''7.566053812169748"'); SetRField(LNewObj,'Callout','__ShowDialog','False'); SetRField(LNewObj,'Callout','Rise','0.19"'); SetRField(LNewObj,'Callout','Text',s1); SetRField(LNewObj,'Callout','DNE','Solid Arrow\1\-1'); SetRField(LNewObj,'Callout','TextFont','Arial'); SetRField(LNewObj,'Callout','TextSize','203.200000'); SetRField(LNewObj,'Callout','TextStyle','Plain'); SetRField(LNewObj,'Callout','ControlPoint01X','-6.417885850025682"'); SetRField(LNewObj,'Callout','ControlPoint01Y','-1''2.1193488700565"'); SetRField(LNewObj,'Callout','ControlPoint02X','-2''0.387966230097589"'); SetRField(LNewObj,'Callout','ControlPoint02Y','-1''4.686503210066775"'); SetRField(LNewObj,'Callout','ControlPoint03X','1''0.000000000000002"'); SetRField(LNewObj,'Callout','ControlPoint03Y','0"'); SetRField(LNewObj,'Callout','ControlPoint04X','9''0.046850393700723"'); SetRField(LNewObj,'Callout','ControlPoint04Y','0"'); SetRField(LNewObj,'Callout','__dbName',''); SetRField(LNewObj,'Callout','__dbUUID',''); (*SetRField(LNewObj,'Callout','__NoteUUID','{9F2CE811-BDA9-4A75-A227-DE086A909B6F}');*) SetRField(LNewObj,'Callout','__NoteDescrip','This is a Callout'); SetRField(LNewObj,'Callout','__KeynoteNumber','0'); SetRField(LNewObj,'Callout','__OldPlaceAs','False'); SetRField(LNewObj,'Callout','__OldBubbWidth','2"'); SetRField(LNewObj,'Callout','__OldShoulder','1''0.000000000000002"'); SetRField(LNewObj,'Callout','__OldLeaderStyle',''); SetRField(LNewObj,'Callout','__IsFlipped','False'); SetRField(LNewObj,'Callout','__isNew','False'); SetRField(LNewObj,'Callout','__version','2800'); SetRField(LNewObj,'Callout','__markerCode','1;0;15;0.125000;0.000000;2;2.000000;'); SetRField(LNewObj,'Callout','Arrow Style',''); SetRField(LNewObj,'Callout','Marker Symbol',''); SetRField(LNewObj,'Callout','Marker Scale Factor','0.039370078740157"'); SetRField(LNewObj,'Callout','MarkerAng','15'); SetRField(LNewObj,'Callout','Marker Weight','1'); SetRField(LNewObj,'Callout','__OldCtrlPt03X','304.8'); SetRField(LNewObj,'Callout','__OldCtrlPt03Y','0'); SetRField(LNewObj,'Callout','__OldCtrlPt04X','2744.39'); SetRField(LNewObj,'Callout','__OldCtrlPt04Y','0'); SetRField(LNewObj,'Callout','Keynote Legend','Default Legend'); SetRField(LNewObj,'Callout','__OldKeynoteLegend','Default Legend'); SetRField(LNewObj,'Callout','Leader Radius','0"'); SetRField(LNewObj,'Callout','OldText',s1); SetRField(LNewObj,'Callout','__IsUseReletivePath','False'); SetRField(LNewObj,'Callout','__DBReletivePath',''); SetRField(LNewObj,'Callout','Text Angle','0.00°'); SetRField(LNewObj,'Callout','Rotate Text','False'); SetRField(LNewObj,'Callout','__OldTextAngle','0.00°'); SetRField(LNewObj,'Callout','__BubbleShadowPenColor','-3'); SetRField(LNewObj,'Callout','__BubbleShadowFillColor','-3'); SetRField(LNewObj,'Callout','HorizontalTextAlignment','Center'); SetRField(LNewObj,'Callout','New Bubble Style V20','None'); SetRField(LNewObj,'Callout','New Vertical Placement','Auto'); SetRField(LNewObj,'Callout','Draw Extended Shoulder','False'); SetRField(LNewObj,'Callout','Text Style Ref','0'); SetRField(LNewObj,'Callout','Text Spacing Index','2'); SetRField(LNewObj,'Callout','Text Spacing Value','0'); SetRField(LNewObj,'Callout','Leader Angle','-135.00°'); SetRField(LNewObj,'Callout','__ObjectRotationAngle','0'); SetRField(LNewObj,'Callout','__DrawTwoSoulders','False'); SetRField(LNewObj,'Callout','__LeadingLeaderPointX','0'); SetRField(LNewObj,'Callout','__LeadingLeaderPointY','0'); SetRField(LNewObj,'Callout','__SecondaryLeaderPointX','2073.75396875'); SetRField(LNewObj,'Callout','__SecondaryLeaderPointY','0'); SetRField(LNewObj,'Callout','ControlPoint05X','5''9.64385703740156"'); SetRField(LNewObj,'Callout','ControlPoint05Y','0"'); SetRField(LNewObj,'Callout','__OldSecondaryShoulderPointX','1768.95396875'); SetRField(LNewObj,'Callout','__OldSecondaryShoulderPointY','0'); HMove(hCallout,xx,yy); DelObject(hText); DelName(fakeName); END ELSE BEGIN SysBeep; AlrtDialog('No Text Object Selected'); END; END; RUN(Test); Quote Link to comment
joestewart4669 Posted August 23, 2023 Share Posted August 23, 2023 You are amazing. Thanks so much! Quote Link to comment
E|FA Posted August 28, 2023 Share Posted August 28, 2023 @FKA Would you mind posting more specific instructions (or your file) to handle multiple text blocks? Quote Link to comment
FKA Posted October 1, 2023 Share Posted October 1, 2023 On 8/28/2023 at 8:16 PM, E|FA said: Would you mind posting more specific instructions (or your file) to handle multiple text blocks? Sure hể a file with the script in it. Script_ConvTxtToCallout.vwx 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.