Jump to content

Recommended Posts

Posted

I'm back at my totally automated project again folks and the users are complaining about some lines not being trimmed in the details. The lines in question are inside of a block which gets inserted. This is an easy task to do by hand, but my project is totally automated...no user input allowed and must be done completely by code. So here is what I have:

 

(command "._INSERT" my_block (polar pt 0 5) "" "" "")
(setq b1 (entlast))

(command "._REFEDIT" b1 "O" "A" "N")
  (command "._TRIM" "nea" (polar pt pi 5.78125)
	   	    "nea" (polar pt (dtr 285.0547) 2.46875) ""
	  		    "nea" (polar pt (dtr 214.3396) 2.75) "")
  (command "._REFCLOSE" "S")

 

But this causes the following error message:

 

*Invalid selection*

Expects a single object.

Posted

perhaps something like

 

(setq pt (getpoint))
(command "._INSERT" my_block (polar pt 0 5) "" "" "")
(setq b1 (entlast))
(setq ss (ssadd b1))
(sssetfirst ss ss)
(command "._-REFEDIT" "O" "A" "N")
  (command "._TRIM" "nea" (polar pt pi 5.78125)
         "nea" (polar pt (dtr 285.0547) 2.46875) ""
         "nea" (polar pt (dtr 214.3396) 2.75) "")
  (command "._REFCLOSE" "S")

 

hope that helps

Henrique

Posted

Thanks hmsilva,

 

I rewrote part of it like this:

 

.
(sssetfirst ss (ssadd b1))
.

 

This eliminated one line of code. I'm still studying the sssetfirst and ssadd commands to become more familiar with them. But this did the trick. I'm now able to edit these blocks on the fly and this will make the users much happier.

Posted

You're welcome, Bill Tillman

Glad I could help

 

Henrique

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