@Edwin.Saez wrote:
works fine, but do you think there would be a way that lisp does not depend on the block exists in the drawing?
maybe you could add a path from where you can load the block automatically,
We would go for the first option, but the program still need to check for the existence of the block, first on the drawing itself, if that fails then from the source
(and
(setq bname
(cond
( bname )
( (cdr (assoc 2 (tblsearch "Block" "block")))) ;<-- your block name
( (findfile "T:\\Edwin\\block.dwg"))
)
)
(setq vp (car (entsel "\nSelect Viewport")))
(setq isvport (eq (cdr (assoc 0 (setq vp (entget vp)))) "VIEWPORT"))
(setq ipoint (getpoint "\nPick point for scale bar")) ;<-- this can be hardcoded to a specific coordinate
)
@Edwin.Saez wrote:
..maybe the lisp can contain the definition of the block?
That is certainly an option.
But we will stick with the first option.
HTH