Jump to content

Yancka

Member
  • Posts

    136
  • Joined

  • Last visited

Everything posted by Yancka

  1. Umm, and is there some "non-normal" way to deal with PIOs and make them event sensitive?
  2. Idea for resetting would be a menu command like: PROCEDURE ResetPIOs; VAR Criteria :STRING; PROCEDURE ResetMyPIOs(h :HANDLE); BEGIN ResetObject(h); END; BEGIN Criteria:=ConCat('(INSYMBOL & INOBJECT & (PON=',Chr(39),'Name Of My Custom PIO',Chr(39),'))'); ForEachObject(ResetMyPIOs, Criteria); END; RUN(ResetPIOs); What's the way you can make a link from PIO to any object? My case - to Sheet Layer, other case might be to SL Viewport?
  3. Hi Matt, CreateStaticHatchFromObject really does the trick but it requires to mess with hatches in drawing. So I decided not to go with hatches but do a bit more hairy way of combining GetBBox, AddHole and ClipSurface. The result is as desired - 1 contour poly and a bunch of lines. Just I don't yet get how to make out of it what I'm intending (I thought this would be easy from this stage but it isn't). I want to get start point and end point information of each line, delete the line and place linear PIO instead (just 1 level PIO nesting at this point). I don't find a way to get handles of line segments after applying ClipSurface and somehow I'm not succeeding with ForEachObject within my path PIO. But I have all lines selected within my PIO (I can delete them with DeleteObjs call). Any hints on way of cycling through this bunch of lines and converting then into linear PIOs?
  4. The direction I'm thinking about is GetBBox and LineLineIntersection usage widley.
  5. Is there a way to establish a link in PIO to Sheet Layer specified by mouse click, retrieve the name of SL, display the part of the name in PIO as a text and later, in case the SL gets renamed, to have the text in PIO updated too?
  6. Is there a way how to organize detail callout sheet references automatically? Ie, I have VP in SL and annotate it. I draw rounded rectangle around objects which are represented in higher detail in other SLs and place something like built-in Reference Marker besides with info about sheet number where the detailed drawing is. Is there any way to set some kind of link and have page number updated automatically? The logical workflow would be: 1. place the Detail Reference objects 2. point the Sheet Layer on which this detail is referenced 3. the sheet number displayed in Detail Reference is retrieved from pointed sheet and in case of sheet re-numbering (which happens all the time) the number of sheet is updated automatically. If there isn't solution for this, consider this a wish list item.
  7. I'm trying to draw hatch pattern type lines on polygon instead of using hatch itself. It's for use in path PIO. The given data would be: 1. poly handle 2. rotation 3. spacing 4. offset distance from 0 The attached pic represents what I want. It's achieved with hatch. I want to make it with lines. The main confusion is about how to determine where the line should start, where end and what to do in case on same line there are 2 or more lines (other words - the line is interrupted by shape of poly). I've just started working on this and haven't developed any solutions yet. The solution isn't obvious this case, so I'm hoping somebody else might have vision or solution for this.
  8. Generating 3D points (stakes) with a script is what I do already and what I meant with "I find it easier to push the button and have 3D points from 2D texts". I played a bit more around with 3D locuses and 3D polys combined as source data for DTM. In plan view it really draws as needed. The problem is with 3D Display. The only 2 modes that seem to be doing it in correct direction are 3D Grid (blur) and 3D Triangulated Contours (bottom of ditch is filled up) and the outcome I succeed to get (see section VPs) is not what I'd expect from 3D points + 3D polys. Miguel, what 3D Display mode and settings you use to have your sections correct?
  9. As far as I know, the trick is in money. If surveyors are required for 2D topography (and mostly they are required 2D) they survey lesser points than they would if were required to make more pricy 3D topography. Somehow all of conversation I've had with surveyors haven't resulted in anything usable to me. I find it easier to push the button and have 3D points from 2D texts. I just tried to create ditch using 3 3D polygons and random Stakes as meadow. Obviously 3D polygons are used just for having 3D points in DTM. The putcome wasn't the ditch. Obviously there isn't such a thing as "feature line" which would force sides of triangles in TIN generated by DTM lie along this "feature line" and only way to have element like ditch to be created correctly is to have additional 3D points where I want the "feature line". Miguel, somehow I don't succeed to create anything like curb using 3D polys. May be you have VW 2010 and some difference is there? Could you share an example DTM with curbs 3D polys?
  10. The purpose is to have correct Existing Site Model in order to design Proposed one and include it (Proposed) also in sections of building. The start is existing Site Model. I've identified the possible workflow to create existing Site Model in 3D from 2D topographic file received from surveyors. The trick is this task is required to be done rarely (once per project) and I'm lacking that level of programming knowledge to code it in reasonable time (comparing amount of time I should invest and time I would save). I assume the script allowing to make 3D from 2D would be advantageous to many architects & landscape architects and therefore some kind of collaboration here on developing it could be possible. If not, I hope at least to receive some coding advise (experienced programmer may find it relatively easy). There are 2 ways how Z data is represented in 2D surveyor files I deal with (mostly created with Microstation and then exported to DWG): 1. Text object displaying Z value. Insertion point of text object (or upper left point of text objects bounding box) gives X and Y. 2. Multiple text objects combined with liner object (mostly polygon, sometimes line, few times polyline), I think in AutoCAD Civil 3D it was named "feature line". This line determines where the border between various relief types are. For example, it divides road, flat area, slope, ditch, hill. Working with text objects only as 3D point source data gives very rough and sometimes inadequate result. Therefore usage of "feature lines" is a must-have. Polygons forming "feature line" have at least 2 text objects on them, sometimes they are closed and sometimes not. They are very varying, besides sometimes text isn't exactly on the line but some distance (6mm) away, if printed it looks like on the polygon but digitally it isn't. Additionally, sometimes length of segment is unreasonably small (3 mm). For example, closed polygon forming lawn in the backyard has perimeter of 80m, has 115 segments and 16 text objects on it. Another closed polygon at the foot of hill has perim 45m, 51 segments and 6 text objects. Linear (unclosed) polygon forming side of the road has perimeter 51m, 5 segments and 6 text objects. The meaning of 3D points (for convenience I'll call text objects 3D points) on polygon is as follows: 1. draw a 3D line from 1 3D point to another; 2. duplicate in Top view and move perpendicularly; 3. create plane using those 2 3D lines; 4. projection of polygon's segments (located between 2 3D points) on this plane would give Z value of each segment. 5. Then you take next 2 3D points (point No2 and point No3) and repeat. My workflow is to create Stake Objects as source data for Site Model. Couldn't make much use of 3D Polys (since couldn't find reasonable way to create them from data given). Probably 3D Polys would be the way... My vision on how it should work: 1. User selects a poly which is to be transformed into 3D Poly and fires the command (this script). 2. The script checks for text objects which lie on this polygon (with tolerance of 20 mm) and which are to be used as 3D points to create 3D Poly. PtOnLine could be used. 3. Performs some really nice calculations (don't have clue on this part) which uses all given data and creates 3DPoly on another layer. 4. Deletes text objects which were used as 3D points. * A step further would be to perform this command automatically on all polygons in specific class and in current layer. Currently I'm doing these actions to have Stake Objects as valid data: 1. Select all polygons forming 1 linear object and all texts lying on that "feature line". 2. Run the script TOPO STEP 1: PROCEDURE TopoApstradesSkripts; VAR Criteria, InitialLayerName: STRING; PROCEDURE SelectObjectsInCurrentLayer(DeSelect: BOOLEAN; ObjectType: STRING); VAR Criteria: STRING; BEGIN??? Criteria:=concat('(L=',chr(39),GetLName(ActLayer),chr(39),') & (T=',ObjectType,')'); IF DeSelect=true THEN DSelectAll; SelectObj(Criteria); END; {---- ---- ---- ---- ---- ---- ---- ----} BEGIN??? DoMenuTextByName('Cut',0); Layer('paligmodelis'); DoMenuTextByName('Select All',0); DoMenuTextByName('Clear',0); DoMenuTextByName('Paste In Place',0); SelectObjectsInCurrentLayer(true,'Poly'); SelectObjectsInCurrentLayer(false,'Polyline'); SelectObjectsInCurrentLayer(false,'Line'); DoMenuTextByName('Cut',0); Layer('teritorijas konturas'); DoMenuTextByName('Paste In Place',0); DoMenuTextByName('Compose',0); IF NumSObj(ActLayer)>1 THEN AlertCritical('Par daudz objektu!','Izveido 1 veselu!') ELSE BEGIN IF GetLS(LSActLayer)<>2 THEN SetLS(LSActLayer,2); DoMenuTextByName('Copy',0); DSelectAll; Layer('paligmodelis'); DoMenuTextByName('Paste In Place',0); DSelectAll; END; END; RUN(TopoApstradesSkripts); 3. Duplicate Text Objects to create temporary Site Model giving approx correct planes for "feature line" segments. This Site Model has to be wider that the poly in order via Duplicating Along Path... (this poly) Stake Objects they could display elevation. 4. Run the script TOPO STEP 2. Thanks to dspearman for Text 2 Stake conversion script (it's adapted here): PROCEDURE TopoApstradesSkripts; VAR Criteria, InitialLayerName: STRING; PROCEDURE SelectObjectsInCurrentLayer(DeSelect: BOOLEAN; ObjectType: STRING); VAR Criteria: STRING; BEGIN??? Criteria:=concat('(L=',chr(39),GetLName(ActLayer),chr(39),') & (T=',ObjectType,')'); IF DeSelect=true THEN DSelectAll; SelectObj(Criteria); END; PROCEDURE SelectPIOsInCurrentLayer(DeSelect: BOOLEAN; ObjectType: STRING); VAR Criteria: STRING; BEGIN??? Criteria:=concat('(L=',chr(39),GetLName(ActLayer),chr(39),') & (PON=',chr(39),ObjectType,chr(39),')'); IF DeSelect=true THEN DSelectAll; SelectObj(Criteria); END; FUNCTION Text2Stake(h :HANDLE) :BOOLEAN;VAR???r, g, b :LONGINT; p1X, p1Y, p2X, p2Y ,p2Z:REAL; NewStake:HANDLE; Objtext:STRING; BEGIN IF GetType(h)=10 THEN BEGIN Objtext:=GetText(h); p2z:=Str2Num(Objtext); GetBBox(h,p1X, p1Y, p2X, p2Y ); NewStake:=CreateCustomObjectN('Stake Object',p1x,p1y,0,False); SetRField(NewStake,'Stake Object','Mode', 'Include as site model data'); SetRField(NewStake,'Stake Object','Style', 'Triangle'); SetRField(NewStake,'Stake Object','Scale Factor', '0.2'); Move3DObj(NewStake,0,0,p2z); END; END; {---- ---- ---- ---- ---- ---- ---- ----} BEGIN??? SelectObjectsInCurrentLayer(true, 'Text'); ForEachObjectInLayer(Text2Stake, 2, 0, 0); SelectObjectsInCurrentLayer(true, 'Text'); DoMenuTextByName('Clear',0); SelectPIOsInCurrentLayer(true, 'Stake Object'); END; RUN(TopoApstradesSkripts); 5. Create Site Model, select polygon and 1 stake. 6. Run the script TOPO STEP 3: PROCEDURE TopoApstradesSkripts; FUNCTION SetStakeNoLabelElevationMode(h :HANDLE) :BOOLEAN; BEGIN SetRField(h,'Stake Object','Mode', 'Set elev to site model'); SetRField(h,'Stake Object','Label Reference', 'No Label'); ResetObject(h); END; {---- ---- ---- ---- ---- ---- ---- ----} BEGIN ForEachObjectInLayer(SetStakeNoLabelElevationMode, 2, 0, 0); { DoMenuTextByName('Duplicate Along Path',0);} END; RUN(TopoApstradesSkripts); 7. Duplicate along path (I was trying to get some help do this programmatically): 8. Run the script TOPO STEP 4: PROCEDURE TopoApstradesSkripts; FUNCTION SetStakeNoLabelSiteDataMode(h :HANDLE) :BOOLEAN; BEGIN SetRField(h,'Stake Object','Mode', 'Include as site model data'); SetRField(h,'Stake Object','Label Reference', 'No Label'); ResetObject(h); END; {---- ---- ---- ---- ---- ---- ---- ----} BEGIN ForEachObjectInLayer(SetStakeNoLabelSiteDataMode, 2, 0, 0); DoMenuTextByName('Cut',0); Layer('reljefa modelis'); DoMenuTextByName('Paste In Place',0); Layer('paligmodelis'); DoMenuTextByName('Select All',0); DoMenuTextByName('Clear',0); Layer('starta topo'); END; RUN(TopoApstradesSkripts); 9. Repeat until done. Then create my Site Model from stakes in DL "reljefa modelis". For having clear picture I attach also VW file of my topo data. Take it as is (some names in Latvian). Any thoughts are welcome!
  11. Thanks Raymond, sounds promising! rrrrr...... this function isn't documented in VW function reference
  12. I'm trying to run Duplicate Along Path command, but this is more comprehensive issue regarding dialog window control in general. My script assumes 2 objects (1 of them is polygon) are selected and I'd like to apply (I didn't find appropriate VS function): DoMenuTextByName('Duplicate Along Path',0); Then I want to retrieve curve length and set duplicate placement as integer which is curve length rounded up, then hit OK. Is it possible with script? The main question is how to set duplicate placement settings as I want and hitting OK programmatically in active dialog window.
  13. Btw, is it possible to create script palette and scripts on it using custom menu command?
  14. Pity. I was already doing that. Thanks, Pat.
  15. Is there a way how to create Site Model with VS? DoMenuTextByName('Create Site Model',0) doesn't work, nevertheless valid source data is selected.
  16. The command can be called using: DoMenuTextByName('Compose',0); Is it possible to call a script from script palette in existing document? For example, in resources of my current file I have Script Palette named "My Scripts" with script in it named "The Magic Button". Is there a way to call "The Magic Button" script from scripts palette "My Scripts" from other script?
  17. Howdy gents, is there a way how to determine if point (X,Y given) lies on pre-selected polygon (polyline, line) or even on multiple of those? Or lies in certain distance (tolerance offset) from those pre-selected linear objects?
  18. This works on one Mac and doesn't work on other. Both Macs have same OS version (10.5.8). This doesn't work only for VW files but works for other applications (tried Safari and Excel), so I assume this is related with some VW preferences... any idea? Update: I switched worskpaces from mine to Standard and then back to mine - and now it's working!
  19. Is there an option to see full address/path of current file? By default it displays only file name with extension. For example, I see "Johns house.vwx" in the documents title bar but would like to see "HDD Name/Projects/2010/John/Johns house.vwx".
  20. Thanks for the answer, Pat! May be somewhere out there are some scripts allowing to create worksheet with desired formatting or format already created worksheet? May be VA schedules would be the way?
  21. Is there a way to set default cell formatting conditions? An example of difficulties regarding this. I apply to all cells font Arial Bold, Size 12, Aligned center (both - horizontally and vertically). Then I create new rows or columns and their formatting is what I consider default default formatting - Geneva font, Size 10, Aligned H: General, V: Bottom. Then I have to select new cells/rows/columns and format them again in order to have desired formatting for entire table.
  22. Hi folks, I'm playing around with PIOs and symbols. Trying insert my PIO in symbol and see if I can retrieve any information about location of specific symbol instance (which is inserted in drawing) from child PIO. Is anyone aware of method to retrieve handle of inserted symbol instance? And how to check if it is inserted? GetParent in this case gives the handle to symbol definition, not the instance.
  23. Oh, mine.... I already was trying to write PIO for this... can anyone with VW2010 test it an approve that it indeed works?
  24. No. With built-in elevation benchmark you can only check the option to Use Control Point and then manually place it on 0 level.
×
×
  • Create New...