benzson11 Posted October 11, 2018 Posted October 11, 2018 is there anyone that can help me create a lisp routine to get: -get the attribute block value (different column) -get position x of a block (different column) -get position y of a block (different column) -then put it on CELL as FIELD. I know that this is possible manually but is there anyone who can create a lisp routine for this. It would be a great help. Thank you in advance, Quote
maratovich Posted October 11, 2018 Posted October 11, 2018 Attach an example dwg file that you have, and what you want to receive. This will facilitate the understanding of the purpose of the work. 1 Quote
benzson11 Posted October 11, 2018 Author Posted October 11, 2018 Sorry for the inconvenience that I cause. please see attached dwg file for the example and also attach the lisp routine that i found c/o lee mac. which select a dimension and automatically field the dimension value to the cell. basically that is what i need. i need a lisp routine to select the block and get the position (x)/(y) or northing and easting of the block and field it directly to the cell. thank you again. sample.dwg DIM2CELL.lsp Quote
BIGAL Posted October 12, 2018 Posted October 12, 2018 A block can return x,y,z etc as a field it is a case of working out the field coding then look at lee's code (setq tStr (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa (vla-get-ObjectId Obj)) ">%).Measurement \\f \"%lu6\">%")) a block %<\AcObjProp Object(%<\_ObjId 1038227968>%).InsertionPoint \f "%lu6">% Quote
benzson11 Posted October 12, 2018 Author Posted October 12, 2018 @BIGAL thank you for your reply. I had tried replacing the field codes in the lisp routine. but I'm not that familiar with some of the codes like on how the lsp will select the object. I can modify simple routine but this is a lot complicated for me. Quote
BIGAL Posted October 13, 2018 Posted October 13, 2018 You will need to repeat the data to cell 4 times using a different value of the field each time. 1st is name, then x, y, z. Did you google block attributes to table there is probably code already out there v's a fair bit of redoing lees code. Quote
BIGAL Posted October 15, 2018 Posted October 15, 2018 Sorry should have posted this as well its an example of adding lines to a table and putting values into cells. Will try to find time to change to fields for you. XYZ points to table.lsp Quote
BIGAL Posted October 15, 2018 Posted October 15, 2018 Try this it has two parts the make table if no table in dwg and I have tried to get something close to what you had. You can add to a table or make a new one. x y block - table.lsp Table create2.lsp 1 Quote
benzson11 Posted October 16, 2018 Author Posted October 16, 2018 @BIGAL WOW!just WOW! thank you so much you save me so much time. Quote
BIGAL Posted October 16, 2018 Posted October 16, 2018 No worries it was sort of useful to add to my ever increasing lisp library for next time. Quote
benzson11 Posted October 16, 2018 Author Posted October 16, 2018 @BIGAL again thank you so much. before it took me atleast 1-2mins per block to get the attribute name, x and y. now it only took me around 2-3 secs per block. hahaha Quote
BIGAL Posted October 16, 2018 Posted October 16, 2018 I am looking at going commercial soon semi retiring and the biggest issue you have with managers is how much you save them for a little upfront cost. if you look at 2 minutes @ $100 / Hour = $3.33 per task, If I charged say $50 for the code that would be 15 setouts but it costs now $0.03 per setout. Like lots of others here we are talking 20 minutes is now 10 seconds but still struggle to get paid for it. Quote
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.