Jump to content

MaxStudio

Member
  • Posts

    319
  • Joined

  • Last visited

Everything posted by MaxStudio

  1. I need a string to spit out text that says the following: 10'-0" i can't get this to work. I create a string variable T1: STRING; I then try to assign the value to the variable T1:='10'-0"'; << That doesn't work I then try to used double quotes T1:='10'''-0"'; << That too doesn't work... How do i get this to work?
  2. Hey Pat, I knew that was going to be one of the answers. lol I'll have to tackle that include directive so I can simplify my life. thanks
  3. ok apparently its not a line limit but a character limit... Has anyone dealt with this problem? I know my code can simplified... but "how" is the question... Does anyone know if Returns count as 1 character... do spaces and tabs count as characters as well?
  4. Is there a limit to how much code can be input into a script? I've written a long code that compiled fine. When I went to run the script I got an output error. When trying to troubleshoot the code I found it cut off my code at line #1866... anyone ever run into this problem? Is this many lines unheard of?
  5. WONDERFUL THANK YOU MIGUEL! Ive gotten a test to work. This part of the dialogs has always confused me. So the number before the ":" such as "5:" is significant to which dialog item is being referenced?
  6. I want to enable certain items when a check box is checked. I figured something like the following would suffice: IF ItemSel(5) THEN SetItemEnable(8,TRUE); or IF ItemSel(5) THEN BEGIN SetItemEnable(8,TRUE); SetItemEnable(9,TRUE); SetItemEnable(10,TRUE); END; I've also tried the following: IF ItemSel(5) THEN check01:= 1 ELSE check01:= 0; IF (check01=1) THEN SetItemEnable(8,TRUE); I can't seem to get any of these to work. Maybe I'm entering the code in the wrong place? I am using modern dialogs. Below is the Dialog I am trying to fit this code into: PROCEDURE Drive_Dialog(VAR item:LONGINT; data:LONGINT); VAR cstr: STRING; BEGIN CASE item OF SetupDialogC: BEGIN { Pulldown Menu 1 } InsertChoice(18,4,'1/4"'); InsertChoice(18,0,'1/32"'); InsertChoice(18,1,'1/16"'); InsertChoice(18,2,'1/8"'); InsertChoice(18,3,'3/16"'); InsertChoice(18,5,'3/8"'); InsertChoice(18,6,'1/2"'); InsertChoice(18,7,'3/4"'); InsertChoice(18,8,'1"'); InsertChoice(18,9,'1/1/2"'); InsertChoice(18,10,'2"'); InsertChoice(18,11,'3"'); InsertChoice(18,12,'1"=10'); InsertChoice(18,13,'1"=20'); InsertChoice(18,14,'1"=30'); InsertChoice(18,15,'1"=40'); InsertChoice(18,16,'1"=50'); InsertChoice(18,17,'1"=100'); { Pulldown Menu 2 } InsertChoice(20,4,'1/4"'); InsertChoice(20,0,'1/32"'); InsertChoice(20,1,'1/16"'); InsertChoice(20,2,'1/8"'); InsertChoice(20,3,'3/16"'); InsertChoice(20,5,'3/8"'); InsertChoice(20,6,'1/2"'); InsertChoice(20,7,'3/4"'); InsertChoice(20,8,'1"'); InsertChoice(20,9,'1/1/2"'); InsertChoice(20,10,'2"'); InsertChoice(20,11,'3"'); InsertChoice(20,12,'1"=10'); InsertChoice(20,13,'1"=20'); InsertChoice(20,14,'1"=30'); InsertChoice(20,15,'1"=40'); InsertChoice(20,16,'1"=50'); InsertChoice(20,17,'1"=100'); { Pulldown Menu 3 } InsertChoice(22,4,'1/4"'); InsertChoice(22,0,'1/32"'); InsertChoice(22,1,'1/16"'); InsertChoice(22,2,'1/8"'); InsertChoice(22,3,'3/16"'); InsertChoice(22,5,'3/8"'); InsertChoice(22,6,'1/2"'); InsertChoice(22,7,'3/4"'); InsertChoice(22,8,'1"'); InsertChoice(22,9,'1/1/2"'); InsertChoice(22,10,'2"'); InsertChoice(22,11,'3"'); InsertChoice(22,12,'1"=10'); InsertChoice(22,13,'1"=20'); InsertChoice(22,14,'1"=30'); InsertChoice(22,15,'1"=40'); InsertChoice(22,16,'1"=50'); InsertChoice(22,17,'1"=100'); { Pulldown Menu 4 } InsertChoice(24,4,'1/4"'); InsertChoice(24,0,'1/32"'); InsertChoice(24,1,'1/16"'); InsertChoice(24,2,'1/8"'); InsertChoice(24,3,'3/16"'); InsertChoice(24,5,'3/8"'); InsertChoice(24,6,'1/2"'); InsertChoice(24,7,'3/4"'); InsertChoice(24,8,'1"'); InsertChoice(24,9,'1/1/2"'); InsertChoice(24,10,'2"'); InsertChoice(24,11,'3"'); InsertChoice(24,12,'1"=10'); InsertChoice(24,13,'1"=20'); InsertChoice(24,14,'1"=30'); InsertChoice(24,15,'1"=40'); InsertChoice(24,16,'1"=50'); InsertChoice(24,17,'1"=100'); END; 1:BEGIN Elev01:=GetField(7); Elev02:=GetField(10); Elev03:=GetField(13); Elev04:=GetField(16); DNum01:=GetField(26); DNum02:=GetField(28); DNum03:=GetField(30); DNum04:=GetField(32); IF ItemSel(5) THEN Check01:= 1 ELSE Check01:= 0; IF ItemSel(8) THEN Check02:= 1 ELSE Check02:= 0; IF ItemSel(11) THEN Check03:= 1 ELSE Check03:= 0; IF ItemSel(14) THEN Check04:= 1 ELSE Check04:= 0; IF (check01=1) THEN SetItemEnable(8,TRUE); GetSelChoice(18, 0, gScale01, cstr); GetSelChoice(20, 0, gScale02, cstr); GetSelChoice(22, 0, gScale03, cstr); GetSelChoice(24, 0, gScale04, cstr); END; END; END; BEGIN g_ID:= Define_Dialog; IF VerifyLayout(g_ID) THEN BEGIN g_Result:=RunLayoutDialog(g_ID,Drive_Dialog);
  7. Its been awhile since I've been around. I've run into this problem again with another script. In both scripts I am trying to create lines. I'm not sure if that commmand is the problem. But... I have noticed something quite interesting. I run the script and my shortcuts stop working. I then delete the script and my keyboard shortcuts are reactivated. That would lead me to believe that the script was still running and preventing my shortcuts from working. Once I deleted the script I recreated it... and guess what? it didn't deactivate my keyboard shortcuts. I have no idea why it would disable them the first time and not the second...
  8. This script creates 2 lines. For some reason once i run the script my keyboard shortcuts cease to work. PROCEDURE CreateLines; VAR X1,Y1: REAL; BEGIN DSelectAll; X1:=58; Y1:=20; PenSize(4); PenPat(2); PenFore(255); PenBack(255); MoveTo(-X1,-Y1); LineTo(-X1+8,-Y1); PenPat(-8); PenFore(7); PenBack(7); LineTo(X1-8,-Y1); END; RUN(CreateLines); Can anyone see a problem in this script that might explain why this is happening?
  9. DWorks, I found this website maybe it will lead you to something http://www.thefreecountry.com/programming/editors.shtml
  10. TEXT WRANGLER DID IT!!!!!!!!!!!!!!!!!! Pat rules the vectorscripting world!!!!!!!
  11. I conducted a short test. One script I copy and pasted from a text editor. The second script I typed the same code directly into the script editor. After compiling and trying to edit, I have noticed that the script that was copy and pasted removed all spaces, returns, and indentations. The script that was typed directly into the script editor retained all spaces, returns, and indentations. Does this mean I have to type all of my scripts directly into the script editor!?
  12. How come when I click on Edit Script all of my code has all the spaces, returns, and indentations removed!? if I try to recompile it gives me errors! I then have to delete everything and re-paste it all into the script editor. How do I get the script editor to not remove my spaces, returns, and indentations?
  13. Hey J, I've tried to create an Alias (shortcut on mac) in the plugins folder but apparently Vectorworks does not seem to find it. Am I doing something wrong? I created the scripts on my computer. I then went to another computer and created the alias to my plug-in folder. Vectorworks on the 2nd computer does not seem to open the alias to my plug-in folder. I guess I could just redirect the main plug-in folder on the 2nd computer to look at my plug-in folder, but that would mean my computer would have to stay on constantly so everyone has access to it. I'll try playing around with it more later today.
  14. Ok the following worked: Procedure Test; Begin Layer('A-01'); SetLayerOptions(4); SelectAll; DoMenuTextByName('Copy',0); Layer('A-02'); DoMenuTextByName('Paste In Place',0); End; Run(Test); The next step is finding a way to reference the number of saved views that exist in the file. Each saved view needs its own design layer with a title block. So i need to figure out a way to reference the number of saved views so I can correctly number my layers. Is this confusing?
  15. currently i'm researching DoMenuTextByName and NNA:Menu Selectors possibly this is the route for me to take... I think my main problem is figuring out a way to activate the Drawing Border so I can copy it. maybe i can just activate the layer, setselect the drawing border and title block, then paste it on the other layer... i just don't know how to reference the drawing border and title block. Possibly a SelectAll will work...
  16. Thanks Pat, but unfortunately it didn't work the way I had hoped. I was hoping that all the content on the layer would be duplicated as well. Another solution to my current problem would be to copy and paste in place a symbol. I have a drawing border with a title block that is on Layer A. Unfortunately if I place the symbol on a new layer it loses its Linked Record capabilities. I'm hoping if I copy and paste the drawing border it will retain its linked record. I guess a 3rd solution would be to just place a new drawing border on the design layer.. i dont know if this is possible.
  17. I'm so close to finishing this layer/saved view script. My current problem is finding a way to duplicate and rename a layer that is currently in the file. Any suggestions? Thanks
  18. OK, i played around with it for awhile and figured it out. I thought the code went at the end of the script. Apparently the code goes at the beginning of the script. I thought the script stated "If cancel is pushed then end." when in reality it states "If cancel is not pushed then begin."
  19. I'm not disagreeing with you but its hard to convince busy people. IF NOT DIDCANCEL THEN main_program_as_a_procedure; END; what do you mean by "main_program_as_a_procedure;"? that is a little confusing to me. can i not just add the following code? IF DIDCANCEL THEN END; Thanks
  20. ha, exactly. Our firm doesn't use the wall tool... yet. Which means we don't work in 3d either. Everything is still done in 2d only because it is more economical, at the moment.
  21. I could set up a template... that is exactly what I am doing, but I want the user to have the option to easily choose how many floors they want. I could make a template with layers and views for the basement first floor and second floor, but what if there is a third floor? or what if there is no work on the second or basement? That would leave the user deleting or creating extra layers. Then if they created new layers, for say a "third floor", then they would have to go and setup all the saved views for that floor. Or they could just work with all the extra layers and just not think about it... but I find having extra layers and saved views in a project as sloppy. The idea is to make a template and only create the layers you need for that specific project. It's much like standard viewports, but our office works in a very specific way so I have to adapt.
  22. Miguel, thats a good point. At the moment the user can type in whatever they want "basement", "first floor", "coca-cola", and it creates the list of layers. I guess I could use a pull down menu or check boxes to list a predetermined list of names. That way it stays consistent throughout different projects. panta, I'm going to have to look into that a little further. I'm a little confused on what your code is saying. Thanks
  23. Ok new problem... When a user runs the script a string dialog pops up and asks for the user to put in a string variable. I can then push 'OK' or I can push 'Cancel' When I push 'OK' the layers and saved views are created as expected. When I push 'Cancel' it still creates the layers and saved views. How do i get Cancel to end the script correctly without creating the layers and the views?
  24. How do I accurately draw site lines using site survey dimensions that consist of degrees seconds and minutes? Example: N 0˚ 41' 03" W S 61˚ 46' 36 E Do I just type it like that into the Object Info Palette?
×
×
  • Create New...