tomjas Posted August 16, 2010 Share Posted August 16, 2010 Hi there, Another idea- this time really challenging (at least for my non-lisp-skill brain). The task is to create lisp to display message box (and the same in command window) with map tile which user needs to insert to the drawing to create Site Location Plan... I’ll try to describe everything below: There is a template drawing with block named ‘GA_SiteLocation’ User is running lisp (which is a task). Lisp is asking: Select SITE LOCATION block. User is selecting block which is already in the drawing. Lisp is reading insertion point of this block (X,Y), and checking 4 points at fixed distance from this point as shown below Then lisp is checking on which tile those points are- using ‘tile extents’ specified in attached excel spreadsheet. So i.e. in first row of the spreadsheet we have top left and bottom right coordinates of tile called NS00. So lisp is checking if any of those 4 points (see graphics above) is in this ‘area’ of tile NS00. By something like: Tile NS00 left X [/color] If this is true ‘store’ tile name If not true, search for rest of tiles until you find correct tile. Check the same for other 3 points. If all 4 points returning the same tile- display message box saying: Insert tiles: (and here will display tile name) If any of those 4 points returning different tile/tiles- display message box saying: Insert tiles: (and here all necessary tile names). Hopefully this is clear what I want to achieve. I know there is a lot of (330) tiles to ‘check’, so I can manipulate data in excel to get the ‘formatting’ you will need... Thank you in advance- and I hope this is really challenging and enjoyable task to do. Tiles top left+bottom right.zip Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 17, 2010 Share Posted August 17, 2010 I think I know what your trying to do but you should be able to work out a single tile reference with out the checking of 330 you have a known x & Y its a case of joining these togther to give name of correct tile once found in the example above the correct tile name would be x-55y-75 Just have 2 loops that counts down the maximum value till such time as the x or y is greater than that new value, accept the prior answer! I would look at what your calling your tiles to match the co-ords or else add a dummy column in excel to reflect some other user known tile answer. Just a bit more are you trying to display 9 tiles ? If so pretty easy once you work out 1 corner. There are all sorts of smart searching list methods you can use but just stepping through is easier to program. 5000 items takes 14 tests to get correct answer. Quote Link to comment Share on other sites More sharing options...
tomjas Posted August 17, 2010 Author Share Posted August 17, 2010 Hi BIGAL, Thanks for your replay. Glad you have some ideas how to solve this problem. I want to display maximum 4 tiles. The reason for this is that Site Location Block can be close to the edge of map tile- but I need to display it in the viewport- so I can't leave 'blank' part... see graphics below Each tile of the map is 20,000 x 20,000 metres. My viewport at 1:50,000 scale is creating (in model space) a rectangle 11,000 x 15,000. Cheers, Tom Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 18, 2010 Share Posted August 18, 2010 The answer is still probably in the coding not in the 300tile approach dont worry about viewport part till you get the tiles to work thats easy just zoom c at a scale. 1 does tile fit in 1 tile 2 yes done no check left then right then up then down 3 all done display the tiles! that got a yes Its still basic math ptx +- a tolerance means add extra tile same in Y direction your site block has a length & width. More than happy to help you with code but I am not going to write it for you. Quote Link to comment Share on other sites More sharing options...
tomjas Posted August 18, 2010 Author Share Posted August 18, 2010 Hi BIGAL Thanks for replay. Unfortunately my knowledge about lisp is limited to ‘study’ code and understand some parts of it, maybe small changes- like change value of variables or names... But anyway thanks for your replays. Regards, Tom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.