Jump to content

setting rectangle fillet and misc


iconeo

Recommended Posts

I'm stuck on this so any help is appreciated.

 

(defun c:plancallout ()
;set variables
 (setq layername "S-ANNO-SYMB")
 (setq layercolor "140")
 (setq restoreosmode (getvar "OSMODE"))
 (setq recradius "0.25")
 (if (= (getvar "cvport") 1)
   (setq recfillet "0.25")
   (setq recfillet (* (atof recradius) (getvar "dimscale")))
 )

;create layer if it does not exist
 (setq laysrch (tblsearch "layer" layername))
 (if (= laysrch nil)
   (command ".layer" "n" layername "C" layercolor "")
 )

;draw plan callout
 (setvar "OSMODE" 0)
 (command "rectangle" "f" recfillet)
 (command ".chprop" s "" "la" layername "lt" "hidden" "")
 (command "rectangle" "f" "0" nil)
 (setvar "OSMODE" restoreosmode)

 (princ)
)

 

These two lines don't seem to work which are supposed to set the layer and linetype and also set the rectangle fillet setting back to zero.

 

  (command ".chprop" s "" "la" layername "lt" "hidden" "")
 (command "rectangle" "f" "0" nil)

 

Thanks.

Link to comment
Share on other sites

Thanks for looking.

 

(command "-layer" "LT" "hidden" layername "")

Yea I know I can do this, but I was trying to change the object after it was created. Oh well.

(setvar "filletrad" 0.0)

This doesn't affect the rectangle fillet setting. Any other ideas?

Link to comment
Share on other sites

Looked like you were creating the rectangle by choosing two cursor points, but I couldn't get it to work in BricsCAD without adding a couple of pauses. I also added ENTLAST to the chprop command.

 

;; plancallout

(defun c:plancallout ()
;set variables
 (setq layername "S-ANNO-SYMB")
 (setq layercolor "140")
 (setq restoreosmode (getvar "OSMODE"))
 (setq recradius "0.25")
 (if (= (getvar "cvport") 1)
   (setq recfillet "0.25")
   (setq recfillet (* (atof recradius) (getvar "dimscale")))
 )

;create layer if it does not exist
 (setq laysrch (tblsearch "layer" layername))
 (if (= laysrch nil)
   (command ".layer" "n" layername "C" layercolor layername "") ;; added layername
 )

;draw plan callout
 (setvar "OSMODE" 0)
 (command "rectangle" "f" recfillet pause pause) ;; added pauses
 (command ".chprop" (entlast) "" "la" layername "lt" "hidden" "") ;; changed "s" to (entlast)
 (command "rectangle" "f" "0" nil)
 (setvar "OSMODE" restoreosmode)

 (princ)
)

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