Jump to content

MullinRJ

Member
  • Posts

    2,004
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. MullinRJ

    Prefs

    Michael, ???The unit mark for inches is a double quote, and not two single quotes next to each other. ???In Pascal strings, the single quote is used as the string delimiter, one at either end of the string. Everything in between is considered text. If you want to use a single quote inside your text, then you have to do something to tell the compiler that a single quote should not be used as a delimiter and should be used as text. Using 2 single quotes together inside the string will translate to 1 single quote in the output, and the compiler will not try to terminate your string when it sees the first single quote in the pair of single quotes. e.g., Don't fence me in. is expressed as a Pascal string as: 'Don''t fence me in.' Note the 2 single quotes in Don''t. Now, if you remove all the letters, so that you only have the single quote remaining in the string you will get: ''''. That's 4 single quotes, 2 for delimiters and 2 for the single quote itself, and not to be confused with a double quote surrounded by single quotes. '"' They look identical in the font on my screen, but they are not. To tell the difference, walk your cursor through the text. Four characters vs. three characters. HTH, Raymond
  2. That's odd, because when I use JOIN on two lines, they join perfectly. Is your problem with the JOIN command or the COMPOSE command? Are the objects you are having trouble joining Line-Line, Poly-Poly or Line-Poly? Raymond
  3. As I enter the sanctimonious halls of this unadorned 700 Club, I look around and see seven others in my midst, but four are soon to leave for higher numerical acclaim. But far out in the distance, over a hill and beyond a cloud of dust, there can be heard the thundering keyboards of the Techboard's Top Five! In the last month the most prolific poster for many years gave up his crown, not to one, but to two noteworthy contenders. islandmon held the lead by a respectable margin for more years than I was paying attention, and on the 12th of last February the lead fell to Christiaan who had been pacing the islandmon for many, many moons. Victory is enjoyed in silence but for a fleeting moment. Then again without fanfare of trumpet or the roll of a drum, the torch passed again a mere 31 days later. CipesDesign currently strides in front of that rising cloud of dust. His position is guaranteed by nothing, and should he turn and look backwards through the haze he may notice another streak, approaching faster than all the others. Ray Libby is gaining on you. Run Peter, run; or be prepared to proffer the torch to the next amazing poster. Thank you all, for your combined and continuing help to this community. Raymond
  4. Jet, How many objects do you have selected when you run the JOIN command? Raymond
  5. Jet, Are you trying to use the JOIN command on all the lines at once? I believe it only works on 2 selected lines at a time. You are in need of a script that would sort through all the endpoints and join the ones that are close. I think what you want can be bought at VectorBits. See ChainMaker. http://www.vectorbits.com/VectorBits_2011/vectorbits/vectorbits.html HTH, Raymond
  6. Hello Helmut, ???The first SYMBOL line will get you the rotation corrected, but the coordinates will still be those from before the Plan Rotation. ???X := -5; ???Y := 10; ???SYMBOL ('Symbol-1', X, Y, -GetPrefReal(93)); ???This will get you working in Plan Rotation for both the XY grid and the angle grid. ???ScreenVecToModelVec(X, Y); ???SYMBOL ('Symbol-1', X, Y, -GetPrefReal(93)); HTH, Raymond
  7. Hi Orlando, ???Good job. 1) Use GetOrigin, then save the values in a record format with NewField; or write them to a worksheet cell; or save them in a text block in a SymDef. Your choice. 2) Use Num2Str(Decimals, Number); 3) You can get the handle to the first object inside a symbol definition with: ???FInSymDef(GetObject('SymbolName')); then get the rest with a WHILE or REPEAT loop and NextObj(). If you change the class of the symbol contents then it will be the same for all symbol instances of that symbol name in your file. Only the placed symbol instances can have different class names from each other. This may be what you want, but I'm not sure what you are trying to do. 4) Change the value in the attached record of your markers by the delta of your elevation move. Whatever value is in the attached record will display in the symbol. Use SetRField() once you get a handle to a symbol's attached record. HTH, Raymond
  8. Orlando, ???You are very welcome. You are trying to move very fast from fancy to luxury. Most of what you are describing would require your static markers to be dynamic. To do that you would need to develop a Plug-In-Object. Definitely not as easy, but very much doable. ???If all you want to do is move everything up or down globally, with what you already have it would be much easier to write another script to adjust your markers. You can change the value stored in each record by a fixed amount and the symbols will then display the new value. ???Have a look at ForEachObject() or ForEachObjectInLayer() and have it modify the records of your symbol instances using SetRField(). You can search the TechBoard for examples of using these calls, several have been posted. Raymond
  9. So, now you want to get fancy? Well you picked a good example to show a neat feature of VW ? linking text to a symbol. If you create one symbol for every elevation marker you place, you'll end up with a lot of symbols that are all the same except for the value inside. VW has a way of creating a symbol with dummy text inside that gets overwritten when the symbol gets placed in the drawing. The magic is in a record that also gets attached to the symbol that has the value you want displayed. I modified your script to do just that. I commented the code to show how it works, but if you'd like further explanation, please write back. Raymond PROCEDURE FindYcoord; { Place a custom Elevation Marker symbol on the drawing that shows the elevation of where it was placed. } { The symbol does not update if moved. The symbol uses Linked Text to show the Elevation. } { If the symbol or record format do not exist when the script is run, they are created. } { To use, click once at the 0 Ref Elev. No marker is displayed, but the reference is stored. } { Subsequent clicks place Elevation Markers relative to the first click. } CONST ElevClass = 'cota altimetrica'; ElevRec = 'ElevRec'; { change this name to suit you } ElevFld = 'ElevField'; { change this name to suit you } ElevSym = 'ElevSym'; { change this name to suit you } VAR x1, y1 : REAL; x3, y3 : REAL; CurrentCl : STRING; BEGIN DSelectAll; PushAttrs; { save graphic state } CurrentCl := ActiveClass; NameClass(ElevClass); SetClUseGraphic(ElevClass, true); SetClPenFore(ElevClass, 0, 0, 0); SetClPenBack(ElevClass, 0, 0, 0); SetClLW(ElevClass, 1); SetClLS(ElevClass, 5); SetClFPat(ElevClass, 0); ShowClass(ElevClass); LSByClass; LWByClass; PenColorByClass; FillColorByClass; FPatByClass; NameClass(CurrentCl); { remove this line if you want the symbol parts in the Elev Class. } { Create the Record Format if it doesn't exist. } IF (GetObject(ElevRec)=nil) then NewField(ElevRec, ElevFld, '0', 3, 0); { Create the Symbol if it doesn't exist. } IF (GetObject(ElevSym)=nil) then begin BeginSym(ElevSym); MoveTo(-0.10, 0.17); LineTo(0, 0); LineTo(0.14, 0.25); LineTo(0.74, 0.25); TextSize(12); TextJust(2); TextVerticalAlign(4); TextOrigin (0.44, 0.27); FillPat(0); BeginText; Num2StrF(0.000) EndText; LinkText(LNewObj, ElevRec, ElevFld); EndSym; end; { IF } PopAttrs; { restore graphic state } GetPt(x3, y3); { This is where the reference elevation is stored } WHILE TRUE DO BEGIN NameClass(CurrentCl); { return to current class } GetPt(x1, y1); { Elevation marker will be placed at this point } NameClass(ElevClass); { Elev symbol instance goes in this class } SYMBOL(ElevSym, x1, y1, #0); SetRecord(LNewObj, ElevRec); SetRField(LNewObj, ElevRec, ElevFld, Num2StrF(y1 - y3)); RedrawAll; DSelectAll END; { WHILE } END; Run(FindYcoord);
  10. Orlando, you shouldn't have to change the User Origin. When this script is running the first click should be at the 0 elevation point to set your reference. No marker is placed on the first click. Markers get placed on all subsequent clicks until the script terminates. Raymond
  11. Hello Orlando, There appear to be two problems in the script that I can see. First, ???WHILE (h1 := 0) DO BEGIN?????{ THIS IS AN ERROR } should read: ???WHILE (h1 = 0) DO BEGIN or better: ???WHILE TRUE DO BEGIN which is the same thing, as h1 is always 0, so it always evaluates to TRUE. Second, these lines have a BLANK at the front of the Class Name: ???SetClUseGraphic(' cota altimetrica',true); ???SetClPenFore(' cota altimetrica',0,0,0); ???SetClPenBack(' cota altimetrica',0,0,0); ???SetClLW(' cota altimetrica',1); ???SetClLS(' cota altimetrica',5); ???SetClFPat(' cota altimetrica',0); ???ShowClass(' cota altimetrica'); but your NAMECLASS statement does not. ???NameClass('cota altimetrica'); They should be the same. Either add a blank to the former or remove the blanks from the latter. I noticed your script does not put your elevation markers into the class "cota altimetrica". If you change your program to replace this line: ???GetPt(x1, y1); with: ???NameClass(CurrentCl); ???GetPt(x1, y1); ???NameClass('cota altimetrica'); you should get the effect I think you are after. When the program exits, your class will be returned to the current class. HTH, Raymond
  12. Ciao Andrea, ???Your code rotates the most recently created object around the User Origin and not around the object's center. Try replacing your line: Rotate3D(protx,0,0); with: Get3DCntr(LNewObj, Xcen, Ycen, Zcen); Set3DRot(LNewObj, protx, 0, 0, Xcen, Ycen, Zcen); If it works, it will get the center of each extrude as it is created and use that point for the rotation center. I haven't tested it, so it may not work. Write back if you need more help. Raymond
  13. I think your only recourse is to rename your folders. Add a number to the front of the folder names to set the order to your liking, or add a series of blanks to select folder names to elevate them in the sorting order. There is no way to drag them into the order of your choosing. HTH, Raymond
  14. It's a change in VW. Raymond
  15. Francesco, ???Every item in a modern dialog has an ID number. When a user clicks on, or types into one of the items, the Modern Dialog "machinery" senses which item was invoked and passes the item's ID number to a routine that you have to write. That procedure will usually have a case statement inside with one case item for every active dialog item ID. You tell the Modern Dialog "machinery" what that procedure is with the RunLayoutDialog() command. ???If your button has an ID of "10", then you will have to write code inside the case statement, for item = 10, to tell your program what to do when it gets pressed. Here's a sample routine for doing something for ITEM 10, which you defined with your CreatePushButton call. PROCEDURE Dialog_Handler(var item :LONGINT; data :LONGINT); Begin ???case item of ??????10: begin ?????????{ Do your thing here } ??????end;??????{ 10 } ???end;??????{ case } End;??????{ Dialog_Handler } There are many short examples in the VectorScript Function Reference. Check out "CreatePullDownMenu" and "CreateColorPopup" for some short examples that work. Also check online at http://developer.vectorworks.net/index.php?title=Main_Page Write back when you have more questions. HTH, Raymond
  16. Guy, Can you reproduce it? If so, would you describe what you are doing when it happens? The Gnd Plane is one of the default Working Planes. It's possible the Working Plane is getting changed by something you are doing, so the menu may be displaying correctly. More info would help dispel some of the confusion. Raymond
  17. Grant, ???Set the drawing mode to Layer Plane. It's in a menu at the top of the drawing window between the Layers and Saved Views menus. Now when you draw you'll be drawing on the Layer Plane, regardless of your view. ???Also, if you want to draw on a 3D layer that already has 2D Planar objects on it, double click on one of the 2D Planar objects and its 3D plane will become the active Working Plane. Select you tool, and make sure the Drawing Plane menu says "Working Plane". Now when you draw you will be drawing on that 3D Plane, regardless of your view. ???To set a 3D working plane, use the Working Plane tool to place a working plane on the face of a 3D object. HTH, Raymond (From the home of Super Bowl XLV - better suited for the Winter Olympics this week)
  18. Hi Mark, ???It's working as it always has, but there is a bug where SetRot3D moves some objects back to the origin (like your cone) and other objects back to the place they were created (like Extrudes) before applying the rotation. This is better seen with an Extrude that is created in one position then moved to another. If you perform SetRot3D on it, it will jump back to it's creation position then rotate. I thought I submitted a bug several years ago, but I may be mistaken. In either case nothing's changed. The good news is you can work around it. In your case, you can rotate first then move it to get the cone's base at (2, 0, 2). hnd := CreateCone(0, 0, 0, 0, 0, 1, .5); SetRot3D(hnd, 0, 45, 0, 0, 0, 0); Move3DObj(hnd, 2, 0, 2); Or you can use Set3DRot() which applies an incremental rotation: hnd := CreateCone(0, 0, 0, 0, 0, 1, .5); Move3DObj(H, 2, 0, 2); Set3DRot(H, 0, 45, 0, 2, 0, 2); Remember to specify the point of rotation in the Set3DRot() call if you move it or create it away from the origin. HTH, Raymond
  19. You can also use the 2D Reshape tool. First convert the Rectangle to a Polygon, under menu Modify->Convert->Convert to Polygons. Then select the 2D Reshape tool and use the second mode in the first group and the last mode in the second group. That's the Change Vertex Mode and the Fillet (Circular Arc) Point Mode, respectively. Set the radius to 0 with the Fillet Preferences... (last tool mode icon on the right). Now, click on the corners you what rounded. By setting the radius to 0, you will automatically get the largest radius possible for that corner. No math required. Raymond
  20. Hello Piero, This line puts the text on the Layer Plane (Ground Plane): ???SetObjectVariableBoolean(objectHandle, 1160, false); which may not be visible when you click in a 3D view. If you set it to TRUE it will draw on the Screen Plane and show where you click: ???SetObjectVariableBoolean(objectHandle, 1160, false); If you DO want it to move with the view then you DO want it on the Layer Plane. I haven't figured out how to do that yet. Can you explain how you want it to look? Raymond
  21. I was just playing in a new project with the colors I picked earlier and I left out a step that bcd outlined. Picking the colors as I described does not save them in any VW document unless you also apply them to something. The system remembers them, though, at least on the Mac. Defining a color palette is also required if you want to easily access them in multiple files. Raymond
  22. Actually, you can pick colors from your screen. I've done it on the Mac with the OS Colors palette. I can only assume there is a similar facility on Windows. In VW's Attributes Palette, click on the Fill Color or the Pen Color rectangle. The VW color palette appears. At the top is a color wheel icon which launches the OS Colors palette. (On the Mac) there is a Magnifying Glass icon that is the equivalent of the Eyedropper tool you referred to. Click on the Magnifying Glass icon and select your color. Then drag your color from the large rectangle at the top to one of the little white squares at the bottom. You can add more white squares by dragging the dot at the bottom of the row of white squares to resize this area of the palette. I can get up to 300 squares. I don't know what you do if you need more. If you get this far, remember to save often. In VW Help, search for "Selecting Standard Operating System Colors". HTH, and Happy New Year, Raymond
  23. But Peter, your picture shows the opposite (0.4 < 0.5). So, is your picture correct or your description? Raymond
  24. James, ???Try this line at the end of your script. ResetObject(LActLayer); HTH, Raymond
  25. You can toggle it with this one line script SetPref(1099, not GetPref(1099)); { toggle Screen/Layer Plane mode } To make it run off a hotkey, see Robert Anderson's post (it's the last option): What do I do with a VectorScript, anyway? If you need help with the Workspace Editor, check the online help or write back here. HTH, Raymond
×
×
  • Create New...