Jump to content

Insert block with attributes


aabfm

Recommended Posts

Hi,

I've been trying tons of different solutions to solve this problem: insert a block that has an attribute which happens to be the last object id.

This is the best code I tried so far but without any succss.

 

(defun c:q1()
(command "_.PLINE")
(while (= (getvar "CMDNAMES") "PLINE")
(command pause)
)

(setq objname (entlast))
(setq oad (getvar "attdia"))
(setq orq (getvar "attreq"))
(setq oec (getvar "cmdecho"))
(setvar "attdia" 1)
(setvar "attreq" 0)
(setvar "CMDECHO" 0)
(setq xScale 1)
(setq yScale 1)
(setq rot 0)
(setq at1 "abc")
(setq pt (getpoint "\nSpecify Insertion Point: "))
(command "_.insert" "TROC_PRP" pt xScale yScale rot objname)

(setvar "attdia" oad)
(setvar "attreq" orq)
(setvar "cmdecho" 1)
)

 

Can you help me?

Kind regards.

Edited by aabfm
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...