Message 1 of 4
XY insert value to attribute?

Not applicable
03-24-2000
11:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Joe - This command does what you want:
(defun C:ATTORD ( / ss i)
(cond
( (not (setq ss (ssget '((0 . "INSERT") (66 . 1))))))
(t (setvar "CMDECHO" 0)
(command "._UNDO" "_Begin")
(repeat (setq i (sslength ss))
(attord (ssname ss (setq i (1- i))))
)
(command "._UNDO" "_En")
)
)
)
(defun attord (blk / att)
(entmod
(list
(cons -1 (setq att (entnext blk)))
(cons 1 (rtos (cadr (assoc 10 (entget att)))))
)
)
(entupd blk)
)
Joe Bailey wrote:
>
> I have a Block of a circle with an attribute inside. Is there a way to get
> the X value of the insertion point to become the value of the attribute.
> I'm trying to create a grid with XY values every 100 MM. I need to insert
> these blocks at the top and sides if the grid and have their respective XY
> values displayed.
>
> Thanks,
> Joe
--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
(defun C:ATTORD ( / ss i)
(cond
( (not (setq ss (ssget '((0 . "INSERT") (66 . 1))))))
(t (setvar "CMDECHO" 0)
(command "._UNDO" "_Begin")
(repeat (setq i (sslength ss))
(attord (ssname ss (setq i (1- i))))
)
(command "._UNDO" "_En")
)
)
)
(defun attord (blk / att)
(entmod
(list
(cons -1 (setq att (entnext blk)))
(cons 1 (rtos (cadr (assoc 10 (entget att)))))
)
)
(entupd blk)
)
Joe Bailey wrote:
>
> I have a Block of a circle with an attribute inside. Is there a way to get
> the X value of the insertion point to become the value of the attribute.
> I'm trying to create a grid with XY values every 100 MM. I need to insert
> these blocks at the top and sides if the grid and have their respective XY
> values displayed.
>
> Thanks,
> Joe
--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.tanzillo@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/