Jump to content

Miguel Barrera

Member
  • Posts

    663
  • Joined

  • Last visited

Everything posted by Miguel Barrera

  1. If you also draw construction geometry that gets deleted at some time in the script, it will be added to the history. You can block this type of code out of the history with the BeginContext and EndContext procedures. You might also want to test how many times the PIO gets reset with the script by using the {$DEBUG} directive in the PIO script. If your code has a reset within the PIO script and an exception is not handled correctly, it could go into loop.
  2. Are you trying to change the lineweights in the document or just the active layer? Using ForEachObject would be a better approach since symbols cannot be selected based on the lineweight. By definition, symbols are container objects that do not have a lineweight and act more like an image.
  3. It is possible to select objects with any type of criteria. First you want to isolate objects based on the same attributes you find in the custom selection command as you said by color,type,etc. using PROCEDURE ForEachObject(callback:PROCEDURE; c:CRITERIA); Then in the callback procedure you can get other attributes from the objects returned and then compare the object value with your own value. For areas, it would be: PROCEDURE SelItem(objHdl: HANDLE); VAR curArea: REAL; BEGIN curArea:= ObjArea(objHdl); IF curArea = 1.2 THEN {Assuming the document units are m2} SetSelect(objHdl); END;
  4. There is a "Counter Top" plugin as of VW 2010 and it does create the back splash and the opening for an oval or rectangular sink but no option for round edges. Still, it could be a good starting point if you want the round edges.
  5. I guess you were not paying attention when I asked in what format does he wants to georeference. I simply pointed out that using shape files is a format that is available. The average user in the US that has anything to do with GIS will have Arcview as it has become the standard for GIS in the US. And since NV is located here, it makes sense to develop the tools for this segment of users first. If you need something different such as GML or any other emerging "standard" then it should be stated in the request.
  6. Try the tool in VW 2011. VW2008 does not have this display option.
  7. Georeference in what format? VW can import and export to a shape file which is georeferenced if it has the projection data. Landmark GIS GIS white paper
  8. The tool you are looking for is called the "Stake Object" and it can display the coordinates although I am not sure if it is localized for the UK. The tool comes with Landmark and most likely with VW Architect too. So if it does not work for you as shipped, you should request NV to modify it which should not take much effort to do. And as "The Expert" did, I developed my own because the stake object does not have all the functionality needed for civil engineering work.
  9. I hope this is what you need. PROCEDURE SelStrInText; VAR searchStr: STRING; PROCEDURE ProcessTextObj(txtHdl: HANDLE); VAR layHdl: HANDLE; layName: STRING; curText: DYNARRAY[] of CHAR; BEGIN curText:= GetText(txtHdl); UprString(curText); {REMOVE THIS LINE IF YOU NEED TO MATCH TEXT CASE} IF Pos(searchStr,curText) > 0 THEN BEGIN SetSelect(txtHdl); {NEXT 3 LINES REPORT TEXT FOUND TO Output.txt IN USER'S DIRECTORY} layHdl:= GetLayer(txtHdl); layName:= GetLName(layHdl); WriteLn(layName,': ',GetText(txtHdl)); END; END; BEGIN searchStr:= StrDialog('Enter text to search',''); IF NOT DidCancel THEN BEGIN DSelectAll; UprString(searchStr); {REMOVE THIS LINE IF YOU NEED TO MATCH TEXT CASE} ForEachObject(ProcessTextObj,(INVIEWPORT & (T=TEXT))); END; END; Run(SelStrInText);
  10. To add a column to the end of the worksheet just drag its edit window to the right at the lower right corner. When you insert from the menu, the new column will be placed to the left of the selected column.
  11. Vlado, We need a visual dialog editor as most modern programming packages. Resources such as images should be stored with the script rather than linked to an external file. It is a pain to build a dialog through command lines and cannot even use the debugger to sort out errors because it crashes VW. The debugger also needs to be fixed as it crashes if you set more than one stop point or even one point inside a loop which crashes VW on the second iteration. Some controls do not work either. I was trying to use a tree control in VW 2008 and although the tree did display correctly, VS would not recognize the control in the event loop. So I switched to 2010 and finally was able to get the click event but then the function to retrieve the text did not work. The only alternative that worked was to save the text in a global string array.
  12. You need to define a variable with a char array to store and retrieve the values as defined in: PROCEDURE SetRField(h:HANDLE; record:STRING; field:STRING; value:DYNARRAY[] OF CHAR); VAR objHandle: HANDLE; recName,fldName: STRING; strVal: DYNARRAY[] OF CHAR; BEGIN .... SetRField(objHandle,recName,fldName,strVal); .... END; Most likely is that the text editor for default values accepts only str255 types but the record field can hold more than 255 characters. Why would you need to enter a default value? I leave text fields for storage with blank defaults because the values will be assigned and retrieved by the script.
  13. Ed, Just like Jeff said above, choosing the "Note Description from Database" in the VW 2010 keynote legend PIO will display the description 06160.b in the callout instead of a number or character. See attached image.
  14. Sorry, I guess this editor does not accept greek characters, the formula above should read: l = rO, where l = arc length r = radius O = Angle of arc in radians.
  15. If you want accuracy, there is nothing better than calculating the stations the old fashion way. The polyline does not need to be decomposed for line & arc segments (only bezier curves would need to). You just need the center and radius. The station point on the arc can be calculated with: l = rφ where l = arc length r = radius φ = Angle of arc in radians. And to calculate exact points along an arc use vector geometry which works with angle & length parameters. I use a custom PIO for centerlines which can be either line or arc segments but the calculations for the stationing are the same as above. It comes really handy when reconstructing a street from existing plans and the data available can be points, stationing, and angles. By the way, we share similar experience with VW. I bought the program (MiniCad 1+ I think) right after I bought my first Mac in 1986 and have developed my own engineering specific tools since scripting was added. You can use the function: ConvertToPolygon(polylineHdl:HANDLE; resolution:INTEGER):HANDLE; (returns a handle to a polygon representing the shape of the polyline) I found a resolution of 64 to be acceptable but you may want to experiment with this value; too small and accuracy is not that good; too high and it may slow down computations considerably.
  16. I think you are confusing the attach record with the "link text to record" command. If you setup a record format which can include numbers, booleans, and text fields, the record is always available in the data tab of the OIP. To attach a record to an object, you just need to select the object and then check the record in the data tab. And if you include the record format in a template, it will always be available for new documents.
  17. You can always attach a record to any object with whatever information is required. I use an attached record to do estimates and keep the format of a linked worksheet uniform. The record has the bid item number, description, unit, and quantity.
  18. The PIO executes the reset event twice when it is being placed on the drawing. The first time is to draw the object outline while moving the mouse and before clicking on the drawing and consequently, it does not have a parent container or layer associated with it. The second time is to draw the object in the layer. You can use ActLayer instead during the first reset event to get the handle of the active layer. hLayer:=GetLayer(hObject); IF hLayer = NIL THEN hLayer:= ActLayer; lScale:=GetLScale(hLayer); IF lscale<1 Then lScale:=50;
  19. Justin, To my surprise, the following also compiled correctly and explains the reason for the group nil handle in your code. Procedure MyDuplicate; VAR i,totDup: INTEGER; grpHdl,Htemp:HANDLE; BEGIN; BeginGroup; BeginPoly; Moveto(0,0); Line(100,0); LIne(0,-100); ENDPOLY; Htemp:=LnewObj; EndGroup; grpHdl:= LNewObj; IF grpHdl <> NIL THEN BEGIN totDup:= 2; FOR i:= 1 TO totDup DO Htemp:= HDuplicate(Htemp,100,0); ResetBBox(grpHdl); END; Message(Concat('Htemp:',Htemp,' Group:',grpHdl)); END; RUN (MyDuplicate); The HDuplicate function places the duplicate in the same container as the original. Since you created the poly outside the group, all the duplicates are created outside the group and consequently, the group is empty at the end of the script and returns a nil handle. But agree with Raymond that the duplicate should be placed in the right container to avoid any changes to HDuplicate in the future. Personally I use CreateDuplicateObject because it gives a handle to the duplicate object for further processing in case I need to modify its size or attributes. Procedure MyDuplicate; VAR i,totDup: INTEGER; grpHdl,Htemp,dupHdl:HANDLE; BEGIN; BeginGroup; BeginPoly; Moveto(0,0); Line(100,0); LIne(0,-100); ENDPOLY; Htemp:=LnewObj; EndGroup; grpHdl:= LNewObj; IF grpHdl <> NIL THEN BEGIN totDup:= 2; FOR i:= 1 TO totDup DO BEGIN dupHdl:= CreateDuplicateObject(Htemp,grpHdl); HMove(dupHdl,i * 100,0); END; ResetBBox(grpHdl); END; Message(Concat('Htemp:',Htemp,' Group:',grpHdl)); END; RUN (MyDuplicate);
  20. A path PIO can be edited with the 2D reshape tool just like you would a polyline/polygon. Line and rectangle PIOs can be edited with the selection tool.
  21. In VW 2008, all this functionality is possible except for the external database connection. It is possible to read an excel file that has been saved as a .cvs (comma delimited) file. If you want the direct connection to the database, you will need to upgrade to VW 2011 which now has the database functions but since they have not been tested extensibly under all kinds of environments, it would be hard to recommend an upgrade at this time.
  22. One of the hardest things for new VW users is to leave behind their Autocad habits which leads them to try to emulate exactly how they used that program. So I wonder, why do you need to "explode" a symbol? If I needed to create a variation of an existing symbol, I would duplicate, rename, and then edit it in the symbol editor workspace.
  23. You are still mixing apples with oranges. How a plug-in object is programmed is not always a limitation of its technology. PIO's are not outdated as you assert but the essence of today's technology. BIM is nothing more than defining objects in a format (XML) that everyone can understand. Programming has not changed dramatically in the past 25 years either. You can now define windows, menus and buttons visually but you still have to write the code to define their actions. In the same way, PIO's will not go away but rather evolve with each VW version. There has been many features added since Diehl Graphsoft (NNA) introduced the technology in the 90's. This is a limitation on how the pio was programmed and not a limitation of pio technology. This can be resolved easily by assigning the parts to classes created by the pio. Then the user can change the class attributes to his liking. I link classes to parts in my pio's all the time so I can change the look if needed. This is in addition to having a popup menu with proposed, existing, removed, and salvaged choices in the OIP which changes the look according to the linked class. "Dynamic Blocks" are also restricted to what they can do and are not as easy to define as you make it appear. There are several steps and menu choices to make to have it working. It would probably take me the same amount of time to do it in VS for such simple functionality. This is exactly the problem when users complain about their software. Designers are not programmers so they cannot change the software to fit their needs (or willing to learn ways to change it). And programmers are not designers so they may have no clue as to what the user really wants (as I wanted to know how much material was needed to build a house and created Wall Framer to satisfy my curiosity). Granted that programming is not easy and will never be as easy as choosing from a menu. But not understanding the technology should not be the sole reason for scraping it. As I mentioned before, what you really want is a visual interface to do simple tasks in addition to VS and the SDK.
  24. Sorry to disagree but the stair by definition is still an Object. In object oriented programming (OOP) anything can be defined as an object that has attributes (shape, dimensions, color, etc.) and responds to actions (clicks, events) through defined methods. The fact that VW cannot modify objects in 3D space now does not mean it will not be able to in future releases. Vectorscript at the moment only allows input and editing in 2D and will need 3D control points in order to edit objects in other views besides the top plan. Once NNA adds this feature to VS, you will be able to manipulate plug-in objects as in the video.
  25. I believe the request was for better documentation and even though Vetorwiki is a good resource it is not well documented either. In several ocassions and specially with drop-in functions or procedures, I had to use the trial and error method to get it working. The following is an example I just picked at random. VS:SubtractPolygon Description Same as ClipSurface. FUNCTION SubtractPolygon( hMinuedPoly :HANDLE; Subtrahend :HANDLE; dFuzz :REAL) :HANDLE; Parameters hMinuedPoly HANDLE hSubtrahend HANDLE dFuzz REAL How would anybody know right away what are the parameters with these descriptions? You can only use deductive thinking where you need two poly handles to do the operation but what is dFuzz? A tolerance factor?
×
×
  • Create New...