Jump to content

Pat Stanford

Moderator
  • Posts

    12,626
  • Joined

  • Last visited

Everything posted by Pat Stanford

  1. Somewhat editable/settable under the Edit tab of Vectorworks Preferences. See the box on the left labeled Arrow Keys.
  2. Option 1. Get rid of the H2 :=FSActLayer. Change the criteria to be (((R IN [MyRec']) & (SEL=TRUE))) Option 2. Begin H2:=FSActLayer; While H2 <> Nil do Begin Put the If statement stuff here; H2:=NextSObj(H2); End; End; Run()
  3. Split by Line has to completely cross the object. With a closed polygon, that means that you have to go across two sides. What you want to be able to do is use two cuts to slice a portion of the poly out. This works on an open poly because it crosses the entire object. I don't know of a way to do what you are trying to do if you want to make the cuts and keep all of the pieces. If you are willing to lose the cut area, you could make a 3D trimming object and to a Subtract Solids.
  4. First, let's make sure we are talking the same thing: 1.This is Callout object that you placed using the Callout Tool from the Basic tools palette? 2. You are positive that you (or someone else) never flipped the object? Copy the following line into a new vectorscript (from the resource browser, select the strange object and run it. It will tell you if the object is flipped or not. If Eval(FSActLayer,(ISFLIPPED))=1 then AlrtDialog('Flipped') else AlrtDialog('Not Flipped'); 3. Do you have Adjust Flipped Text turned on in Document Preferences, Display tab? The shortcut is command-J, so it is possible that you could have hit it accidentally.
  5. Can you post pictures of what you are talking about? Or even better post a VW file with the original are and the NURBS curves so we can look at what you actually have?
  6. Maybe this has already been made clear, but there are four main ways to change the visibility of classes. 1. Manually change them using the Navigation Palette or Organization Palette. 2. Create a Viewport and change them inside the viewport. This will only effect the visibility (and possibly attributes) for that viewport. 3. Write a script to set visibilities. 4. Use a Saved View (which is basically just a script to set visibilities. So if you use a Savied View, and then change layers manually, the class (and layer) visibilities will still be the same as after you used the Saved View. If you are going to use Saved Views, you should probably create one that will turn on the visibility of ALL the classes. I see three options for your current problem. 1. Continue to manually turn the class back on now that you know why it is turning off. 2. Change the class of the objects to one that is always on. 3. Make another Saved View that has the correct layers on for the sheet layer and use that to move to the sheet layer.
  7. This seems to work in Python. But I have done VERY LITTLE (Extremely Little) in Python. import vs; def Set_CoordinateField(MyHandle): MyRec = 'COORDINATE' MyXfield = 'X Coordinate' MyYfield = 'Y Coordinate' MyRot=vs.GetSymRot(MyHandle) PtXY=vs.GetSymLoc(MyHandle) if (abs(MyRot) == 90.0): vs.SetRField(MyHandle,MyRec,MyXfield,vs.Num2StrF(PtXY[0])) if (abs(MyRot) == 0.0 or abs(MyRot) == 180.0): vs.SetRField(MyHandle,MyRec,MyYfield,vs.Num2StrF(PtXY[1])) vs.ForEachObject(Set_CoordinateField,'((R IN [COORDINATE]))')
  8. I think of them as the SUM and Sort tiles even though they look like buttons. Select a row in the database then DRAG the SUM tile to the Column Header (A, B, etc.) You should now have a single row for each unique value in the column you SUM'd. You can use multiple SUMs. If you need to know how many objects are SUM's, add another column and put a formal of =COUNT in the database header row.
  9. Can you post a stripped down file with an instance of the symbol and the record format and the script already in it? It will make it much easier to make sure we are setting the symbol and record EXACTLY the same as you are. BUT, based on a quick read, you are not nesting your IF statements properly. Try this instead: IF (GetSymRot(H2) = 90.0) OR (GetSymRot(H2) = -90.0) THEN Begin GetSymLoc(H2,Item_X,Item_Y); SetRField(H2,MyRec,MyField,Num2StrF(Item_X)); end; IF (GetSymRot(H2) = 0.0) OR (GetSymRot(H2) = -180.0) THEN Begin GetSymLoc(H2,Item_X,Item_Y); SetRField(H2,MyRec,MyField,Num2StrF(Item_Y)); End; The way you have it written the GetSymLoc is part of the If statement and the SetRField is just another line of code that is always run. Another possibility would be to pull the GetSymLoc up above both Ifs (you only need it once), and then the SetRField would be part of each If.
  10. With the door selected and the Selection tool selected (and in either of the two Interactive reshape modes (not the first one with the red circle with a line through it)), you should get a blue reshape handle at the middle of the ID label. Click and drag that to where you want the label.
  11. It is the database header and is there to hold the formulas for each column in the database. Go to View menu on the worksheet and uncheck the Show Database Headers to hide that line.
  12. This command allows you to restructure a drawing, by "automatically" changing the names and number of layers and classes in the drawing. What are you hoping it will do? Much easier question to answer than a full blown explanation that might not actually solve your problem. General intent of the command is to be able to merge multiple classes into a lesser number of classes. For instance, an imported DWG with hundreds of classes (0, 1, E2, etc) could be "mapped" down to a much easier to handle number, possibly with a prefix showing where they are coming from. Since once you have the mapping set up you can "save" that mapping, the next time you need to import from that source the classes/layers can be reduced much more easily.
  13. Not that I know of. AlrtDiaog and StrDialog also are limited to 255 (not 256) characters, at least in their display code. Even the Modern Dialog commands appear to be limited to the 255 character maximum for String variable types. I would suggest his is worth an Enhancement Request to convert all of the display routines to handle DynArray of Char rather than String data types since they are only one way compatible.
  14. Other commands you might want to consider for getting the point of interest (depending on the objects you are working with) are GetBBox [Get Bounding Box] and Get2DPt [Get 2D Point].
  15. What you don't say is the requirements for using the script. 1. You must have a record in the file named "COORDINATE" in the file. 2. That record must have fields named "x coodinate" and "y coodinate" 3. The record must be attached to each object to want to locate prior to running the script. 4. All the script does is move the X and Y coordinates (insertion point) of the object into the COORDINATE record. Anything else you do with them from there is separate. So, you formatting of the output of the data will depend on how you are using the record data. A good first step would be to edit the Coordinate format and make sure the x and y fields are defined as Numbers and formatted as Dimensions (click the Format button). The format of the display should then automatically flow from the Unit settings of the file. If you are using a worksheet make sure the column (or cells) displaying the data is/are also formatted as Dimension. Two other hints: 1. For a script with this few lines, I would hard code the Record and Field names rather than assigned them to variables. Yes if you have to edit the names you have to change them in two places rather than one, but to me it makes the script easier to understand. 2. I would try to make Record and Field names a single string without the spaces. i.e. x_coordinate rather than x coordinate. There are places where a single "word" can be used without the surrounding quotes necessary when you have spaces. Here is a script that actually runs. There is no default fields for X and Y in MyRec, so it can't get the data. You have to use some sort of command to query the object and get that data and store it not the record. In this case I chose GetSymLoc, but depending on the object type you have that might or might not get you the point you are interested in. Procedure Set_CoordinateField; const MyRec = 'COORDINATE'; My_Xcoordinate = 'x coordinate'; My_Ycoordinate = 'y coordinate'; var Item_X, Item_Y:Real; Procedure MyProc(H2:Handle); Begin GetSymLoc(H2,Item_X,Item_Y); SetRField(H2,MyRec,My_Xcoordinate,Num2StrF(Item_X)); SetRField(H2,MyRec,My_Ycoordinate,Num2StrF(Item_Y)); End; Begin ForEachObject(MyProc,((R IN [MyRec]))); End; Run(Set_CoordinateField);
  16. As far are I know there is not a tool to convert python to VS. BUT, Vectorworks now supports Python scripting as well as VectorScript. Basically all of the VS calls can be made from Python by prepending them with VS. Take a look at the online function reference at for example Python (and VS) code for most of the functions and procedures. That being said, I am a VS guy, and have done almost zero Python coding.
  17. Plug-ins have the ability to update when they are moved or rotated (as well as other events). So it is not so much running in a loop as being able to update when it is moved. The script would have to be manually invoked after a move for the data to be updated.
  18. Mike, The primary dimension unit is set on the General Display tab. The secondary dimension unit is set on the Dual Dimensions tab.
  19. First the easy part: To get the cells to show as dimesions, format the cells as Dimension rather than General. Select the header row (or the entire column) go to the Format menu of the worksheet, choose Cells, Select the Number tab and then choose Dimension. As to your second question, without scripting, no there is not way to do what you are trying to do. You could create a Plug-In Object that would automatically use the location of the object for the X and Y locations. Or you could run a script that would populate the record with the right data. The first is more work as it has to be set up to handle all of the formatting you might want. The second is only accurate immediately after you run the script. You would have to rerun the script every time you move a symbol. Sorry.
  20. Or you can make the objects you want to isolate a group and turn off the preference to Show Other Object in Edit Modes (or something like that).
  21. This puts a kind of dashed highlight around whatever object is currently under the mouse and that can be used for snapping to. Create a new file. Draw a Rectangle. Deselect it. Select the Line tool. Hover over the edges of the rectangle. You should see it take on a dashed grey line over the edges to let you know the object is snappable. If you want to see it better, you can go into the Interactive Appearance Settings and either change the size or opacity or make it a different color. Someone else I was just speaking with thinks that the delay on it should be set to 3 to 4 seconds. I am so used to it that I find even a 0.25 second delay is distracting.
  22. Take a look at this thread. https://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=210046Post210046 I posted a couple of scripts that will create worksheets that will show you all the classes and the number of objects in each. Start at the bottom of the thread and work backwards so you get the latest versions of the scripts.
  23. I am not certain that it is an UndoOff issue, but it might be a PIO issue. I can't find it in my email history, but I think that the script of a PIO has to run multiple times when it is first placed into a drawing. I think it has something to do with going in with the default values and then updating to use the actual parameters. Hopefully someone else will be able point this out. I made a linear PIO out of your script and got the multiple regenerations. I then commented out the UndoOff and got the same result. If your work around is doing what you need then that is great. I don't have another work around.
  24. Are you referring to Pre-Selection Highlighting? When you move over an unselected object, it will temporarily highlight to show that if you click it will become selected? Or the Snap Highlighting? This works similarly, and temporarily highlights the object that the snap point will be taken from, but only while you are hovering over the object. As soon as you start to move away, it will revert to its natural color. It would be good if the Snap highlight stayed until you moved to another object or clicked. If it is neither of these, please ask your question differently as I don't understand.
  25. If you don't need this right away, the Subdivision Surfaces coming in VW2016 will probably make this pretty easy. https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CB8QtwIwAA&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DDh1TydxBfhQ&ei=v8GJVaOWHMbmoASv8aaAAQ&usg=AFQjCNFCEGKkxaHHUyu9NXijg_7CQ7vJiA&sig2=33pOfTtkCfNc8dYv-zuokg&bvm=bv.96339352,d.cGU
×
×
  • Create New...