Customise a block to show z attribute

Alij
edited February 2023 in LISP Codes
I am trying to create a block that can be inserted at a z value and display the z value as text. I then want to move it to 0 but keep the text is this possible?

Comments

  • Hi Alij,
    what should the final result look like? If you just want text in the xy plane you can use getpoint and create a text only using the X and Y coordinate.
    (getpoint [ refPoint ] [ prompt ] )
    This function pauses for user input to specify a point, relative to refPoint.
    Example
    (setq delta (getpoint))
    (setq delta (getpoint "\n* Show new location : "))
    (setq delta (getpoint '(0 0 0))
    (setq delta (getpoint '(0 0 0) "\n* Show new location : ")
  • Piet thank you. I did manage to figure something out but will look at this for sure
  • Look into fields also, move block and z label will change etc.
  • Use a field with the Z value of the position of the object
  • @Alij, I have the exact same problem right now, could you tell me how you solved it?
  • Just look at mtext and the field option. Can pick the position X Y Z or just 1.
  • aridzv
    edited August 2023
    @Simon1208

    the idea is to create a block with attribute,
    insert a field in to that attribute that will hold the "BlockPlaceHolder" property of the object.
    I attached here 6 screenshots that illustrate the proccess and a sample drawing.

    if you change the Z value of the block in the drawing after it is already inserted you need to update it with the UPDATEFIELD command.
    hope it helps.
  • You can automate the sequence in a lisp insert block and attribute has field added. So no need for manual adding field.
  • Hi Steve,

    I cant actually remember why this was a problem for me now if I am honest as I just flatten it. I think as I was new to this type of block I had some confusion.

    Hopefully you are sorted now?