Jump to content
benzson11

put FIELD in CELL

Recommended Posts

benzson11

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,

Share this post


Link to post
Share on other sites
maratovich

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.

  • Like 1

Share this post


Link to post
Share on other sites
benzson11

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

Share this post


Link to post
Share on other sites
BIGAL

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">%

 

 

Screen Shot 10-12-18 at 01.12 PM.PNG

Share this post


Link to post
Share on other sites
benzson11

@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. 

Share this post


Link to post
Share on other sites
BIGAL

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.

Share this post


Link to post
Share on other sites
BIGAL

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

Share this post


Link to post
Share on other sites
BIGAL

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

  • Like 1

Share this post


Link to post
Share on other sites
benzson11

@BIGAL WOW!just WOW! thank you so much you save me so much time.

Share this post


Link to post
Share on other sites
BIGAL

No worries it was sort of useful to add to my ever increasing lisp library for next time.

Share this post


Link to post
Share on other sites
benzson11

@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
 

Share this post


Link to post
Share on other sites
BIGAL

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×