Jump to content

LarryO

Member
  • Posts

    428
  • Joined

  • Last visited

Everything posted by LarryO

  1. Thanks Kevin. It must be some quirk in VW2013. The work around will have to do. I'll just need to remember if I have a similar situation in the future. I took 3-4 hours to investigate thinking I made some kind of mistake, even though the complete script compiles without error. With the exception of attempting to allocate the variable some memory before its first use. That crashed VWs as soon as I closed the script window.
  2. It would appear that assigning a parameter to a dynarray of char is not possible. My parameter PSizeH4L is up to 16 characters long from a predefined pop-up list. The assignment := in following doesn't seem to pass a value: VAR StudLength:DYNARRAY[]OF CHAR; BEGIN StudLength:=PSizeH4L; DELETE(StudLength,1,6); MESSAGE('Length= ',Studlength); END; BUT the following does work VAR StudLength:ARRAY[1..16]OF CHAR; TempDynArray:DYNARRAY[]OF CHAR; BEGIN StudLength:=PSizeH4L; TempDynArray:=StudLength; Delete(TempDynArray,1,6); StudLength:=TempDynArray; MESSAGE('Length= ',Studlength); END; Also is there some reason that ALLOCATE TempDynArray[1..16]; crashes VW2013 when used in a point plugin object? Thanks.
  3. Forgot to mention that for all of us lefties there is a left-handed version of the Razor Death Adder mouse.
  4. Does anyone know why Tool type scripts assume I want to insert an object first? Is there a setting that I am not aware of? In the temp tool help message area, top left of window, the message...'MyToolName Click to insert.' is displayed. This occurs even when I attempt to reset the TempToolHelp message prior to the GetPt comand in my script. My message didn't display until I attempted to place my symbol later on in the script. There are NNA tool scripts that don't place objects, such as Fillet. It would also be more appropriate for the selection box appear instead of the tiny cross hair when selecting my first point as this is when I am selecting a PIO I created prior. Then I place my symbol using the data extracted from the PIO instance. I'm not sure what a command for temporarily changing the cursor type would be called or what class it should be a part of. The need for books with good indexes and examples of use is not over but is frequently lacking for many pieces of software these days. Too costly I guess.
  5. Thanks Miguel That was the little tidbit that I needed.
  6. OK, so I have come to realize that GetSymName(Objh) is not going to give me the name of the PIO but can't seem to find the correct function. Now this is not a Name as in Named objects but the name of the type of PIO if that makes any sense. Like the 'Angle' and 'Eye Bolt' PIO's. Anyone know which function is required? Thanks
  7. Ok, so I have gotten really close here. I have determined the location of the object and cycled through the visible layers of the viewport seeking my PlugInObject. While I have partial success with PickObject, I had hoped to use ForEachObjectAtPoint in case my PIO was inside a group. What I found is that ForEachObjectAtPoint locates part(s) within my PIO but doesn't find PIO itself. Is this a bug? Not sure how to create those fancy HTML boxes that some of you use for inserting your script here. So here goes the old fashioned way. Procedure LocatePoint; VAR VPortGrpH,VPortH,LocusH,TestObjectH,PIOObjH,SearchLayerH:HANDLE; VPOriginX,VPOriginY,VPScale,SelectPtX,SelectPtY,ObjPtX,ObjPtY:REAL; Bool1:BOOLEAN; I1,ObjTypeI,VisibilityI,I2:INTEGER; FUNCTION FirstStairPIO (Objh:HANDLE):BOOLEAN; BEGIN FirstStairPIO:=TRUE; Message(GetTypeN(Objh)); IF (GetTypeN(Objh) = 86) THEN BEGIN Message(GetSymName(Objh),'x'); IF ('_StairOutline'=GetSymName(Objh)) THEN BEGIN DSelectAll; SetSelect(Objh); FirstStairPIO:=FALSE; END; END; END; BEGIN ObjPtY:=0.0;ObjPtX:=0.0; SelectPtX:=0.0;SelectPtY:=0.0; ObjTypeI:=0; VPScale:=1; {Where am I?} Locus(0,0); TestObjectH:=LNewObj; LocusH:=TestObjectH; IF TestObjectH≠NIL THEN WHILE NOT((GetTypeN(TestObjectH)=11)|(GetTypeN(TestObjectH)=0)) DO TestObjectH:=GetParent(TestObjectH); VPortGrpH:=TestObjectH; VportH:=GetVPGroupParent(VPortGrpH); ObjTypeI:=GetTypeN(VPortH); VPOriginX:=GetObjectVariableReal(VPortH, 1024); VPOriginY:=GetObjectVariableReal(VPortH, 1025); VPScale:=GetObjectVariableReal(VPortH, 1003); DelObject(LocusH); {SetTempToolHelpStr('Select stair.');} VSave('TempVPsave'); {Save user's environment} GetPt(SelectPtX,SelectPtY); {Inquire user for location of StairPIO} ObjPtX:=SelectPtX-(VPOriginX*VPScale); {adjust location for scale of viewport} ObjPtY:=SelectPtY-(VPOriginY*VPScale); DoMenuTextByName('Group Navigation Chunk',2); {Exit Viewport edit mode} {Search for object on viewport's visible layers} PIOObjh:=NIL;I1:=NumLayers; SearchLayerH:=FLayer; WHILE (I1>0) and (PIOObjh=NIL) DO BEGIN {cycle through layers but stops when an object is found} I1:=I1-1; IF NOT(2=GetObjectVariableInt(SearchLayerH,154)) THEN BEGIN {Ignore sheet layers, this step may not be req'd} Bool1:=GetVPLayerVisibility(VportH,SearchLayerH,VisibilityI); IF 0=VisibilityI THEN BEGIN Layer(GetLName(SearchLayerH)); ForEachObjectAtPoint(FirstStairPIO,1,0,ObjPtX,ObjPtY,1.0); PIOObjh:=LSActLayer; {PIOObjh:=PickObject(ObjPtX,ObjPtY);} END; END; SearchLayerH:=NextLayer(SearchLayerH); END; {Message(ObjTypeI,'x',ObjPtX,'x',ObjPtY,'x',GetLName(SearchLayerH));} IF PIOObjh≠NIL THEN DelObject(PIOObjh); VRestore('TempVPsave'); {Return user to his environment} VDelete('TempVPsave'); END; RUN(LocatePoint);
  8. Resolved I needed to exit viewport annotation mode before attempting to change layers. DoMenuTextByName('Group Navigation Chunk',2);
  9. Anyone know why Layer() doesn't completely switch to the active layer when in the user is in Viewport Annotation mode? Or is there another function I'm not aware of in lieu of PickObject that accepts coordinates and a layer handle? I use: VSave('TempView'); GetPt(SelectPtX,SelectPtY); ObjPtX:=SelectPtX-(VPOriginX*VPScale); ObjPtY:=SelectPtY-(VPOriginY*VPScale); Layer(Lname); PIOObjh:=PickObject(ObjPtX,ObjPtY); VRestore('TempView'); VDelete('TempView'); in that order but PickObject() doesn't detect the object at the specified location. If I don't restore the saved view I am left seeing the specified layer on screen but only the now invisible objects that were in the annotation area of the viewport remain selectable. The exit viewport annotation button also is active in the top right corner. So vectorworks still thinks I am editing annotation but now shows the specified active layer objects which do not appear to be selectable. As per my previous message I am attempting to get a handle to an object that I see while in viewport annotation mode in order to extract data from said object. I will capture the visible layers of the viewport and I attempt to use the calculated point with PickObject() to get the object's handle before returning the user to viewport annotation mode. Thanks
  10. I like using two monitors. A wide screen type for my primary is a must. With my palettes either to the far left or right of the primary. This way I can see it all by only moving my eyes and not my head. My second screen I usually place reference materials like a pdf or second drawing file with the screen slightly to one side of the centre primary screen. I seem to acquire less paper clutter over my keyboard and mouse surface by doing so.
  11. As many shortcuts as I remember that can be selected with my left hand, thumb and two fingers max. Otherwise I find I am looking down for where I left my mouse (right hand) and or straining my hand muscles or is that ligaments. I for as long as I have used VW/MiniCad have switched the #1 & #2 shortcuts so that #1 is line & #2 is text. Also having a keypad at the left side has significantly reduced the frequency with which I reach across the keyboard to press enter or return. I found I used add and subtract surface when I switch the default shortcuts but forgot what keys they were while I worked in an Autocad office. It is easier to use the pull down than to release the mouse and use my right hand for the default - combinations.
  12. Not sure I have quite grasped the complete scope here but isn't this something that could be accomplished by passing two vectorscripts to Vectorworks via (on Mac platform) Applescript and the DoScript command? First vectorscript passed would Open the source file, parse the data, save said list to an external data file, close source. Second would open destination file, read in saved data, then save and close destination file and delete external data file.
  13. Thanks Josh, The where am I locus technique was one of the first techniques I needed back in the 90's MiniCad 5 for switching & setting standardized classes to work at the push of a keyboard button. It was very satisfying the first time I used it successfully. What I was having troubles with was inconsistent results when investigating the number of parents while trying to capture the viewport handle. I was initially using a PIO point object for my code because the object I need displays information in a viewport annotation space. A link is required to the measured object in a drawing layer to keep the data current. I was trying to setup that link and place the annotation PIO within the code of that PIO. I am realizing now that I will probably need to use a Tool script to link and place that annotation PIO and then add some code into my measured PIO which will force an update of the annotation PIO whenever the measured PIO's data is changed. Another little fun project for my spare time.
  14. Know that 0,0 the origin of a PIO is the same concept as a symbol. Where you click the mouse during placement is 0,0 inside the PIO environment for a Point type PIO. I you are new to programming code/languages and don't think you can juggle all the process in your head write it on paper. Take a shell script as your starting point, no code between the first Begin statement final End statement. Determine you input parameters. Know that when retrieving their values in your code you place a 'p' in front of the name you gave them. You need three for this project; two text types and one drop down list. The latter for the colours. Know that a Handle variable is like a leash to your dog. So immediately after creating an object like your Hexagon or text field you will want to capture and store in a variable its handle. This is primarily true if you set all the object's characteristics after its creation instead of before or during creation. I find it easier to search for and understand the commands I need by having the language guide open on a second screen in my web browser. Try using BeginPoly; AddPoint(x,y);...EndPoly; for your hexagon. You can capture the 6 vertices of the hexagon in your symbol and use them if the hex is centred on 0,0. Getting your text placement to your liking is similar but may be a little harder the first time around.
  15. I've used the Razer Death Adder for the past couple of years. I found that most mice on the market were too small in my hand so you were forever having to grip them with your finger tips instead of moving them with the palm one's hand. This is a corded mouse with close to 1.8M[6'] of braided cord. Held with the right hand. Has two well place thumb buttons which are good for layer/page up and down functions. There is a driver for both Mac and Windows platforms. It uses the cloud to remember your settings should you use more than one computer. Those settings can be application specific and/or global. The polling/scanning rate is adjustable from 100 to 3500. I use it at 1800. And if you are a admirer of glitz/glamor the internal led lights can be on or off with one model having changeable colours. Check around on the price. This isn't a dollar store mouse and I have seen some outlets price it over $20 above the average retail price which was about CAN$65 last time I bought one (Jan 2015). Driver/software updates seem to be automatic on both platforms. The only problems I've had is on glass and wood grain finishes. Then I lay down a playing card mat which is essentially a thin mouse pad the size of a large placemat.
  16. Does anyone have a technique for getting the handle to an object which is seen through a viewport and chosen/picked while in annotation mode? Ultimately I wish to extract data from an instance of my PIO when placing a custom PIO annotation tag. BUT first I need to some how capture the handle of that PIO that I am seeing in the viewport.
  17. Do you have an extra END statement? There is a limit to the number of characters permitted. Reading from the Function Reference I would say SetDimText is doing exactly what it is supposed to do. Replacing the dimension text. "Procedure SetDimText will set the dimension text of the referenced dimension to the specified value. The maximum length for dimension text is 60 characters. The first 30 characters of the specified dimension text string will be displayed in the primary dimension string; the remaining characters will be displayed in the secondary dimension string, if it exists." Perhaps using SetObjVariableString(Handle,10,'STRING'); followed by ResetObject(Handle); or SetObjVariableBoolean(Handle,6,TRUE);
  18. The middle circle appears to have it's radial axis rotated 90? CW about the circle's centre origin. If this is not clear to you take a circle and change the 360? in the OIP to 180. Now do a 2nd circle but rotate it 90? before changing to 180?. The start point of the arc is the circle's radial origin. The sweep definition is connecting the radial/circumference origins of the three circles then moves onto the next segment in the rotation about the circle's centre origin.
  19. Does anyone know of the correct method to batch print a series or selection of sheets utilizing both sides of the paper? My printer permits "two-sided" (double sided sided) printing. I have successfully done so from PDF booklets. It seems such an unnecessary step to export from VW to pdf and then re-assemble the pages before one can print a booklet. When I attempt to print from VW using batch printing the sheets still come out one-sided even though I've selected the two-sided option in the printer dialog. Thanks Larry
  20. The stuff between the curly brackets {stuff} is ignored by VW when running the script. Paired curly brackets are simply a means to add notes anywhere into the script, usually to leave yourself clues as to what your script is doing when you look at it weeks later and say what the heck did I do here. :-) The script above might not stop for the user to utilize the text tool before resetting the class back to the initial active class. Larry
  21. A vectorscript tool to improve the text tool. Create the tool's script; insert it into your tool workspace; remove the short cut from NNA's text tool then apply it to the improved text tool. Disclaimer: I've not tried or debugged this, it may flop or not produce the desired results. I'm thinking something like this. Larry PROCEDURE ImprovedText; VAR PopClass:String; BEGIN PopClass:=ActiveClass; NameClass('text'); {this also creates a class if it doesn't yet exist. Note: max 20 characters.} CallTool(-200); {-200 is the VWorks text tool} {this is where the script might fail. It may not know when the user is finished with the text tool, not proceeding onto reseting the active class} NameClass(PopClass); END; RUN(ImprovedText);
  22. Thanks guys. I successfully utilized the SetParameterVisibility to hide or display parameters of my beam coping plug-in. By hiding optional parameters the object info palette is more readable for the majority of the plug-in's instances. Larry
  23. Is the means to show/hide and activate/deactivate parameter fields (in the object information palette) part of the Vectorscript command set? Or does one need to utilized the SDK to enable these types of functions? If it is in Vectorscript, what class of function is it? Are they Compiler related conditions like using IF? ???? Larry
  24. Thanks. I guess the text was so small I couldn't see that the menu item said zoom! lol Larry
  25. I cannot seem to find a means to enlarge the text in the work/spreadsheet editor. I'd like to change the zoom factor to 125-140%. I could lower the monitor resolution or buy another pair of eyeglasses for viewing the editor, but neither seem practical. Larry
×
×
  • Create New...