biblop - 12/7/2010 à 17:02
Bonjour à tous,
Pouvez vous me dire s'il est possible de transformer du texte en bloc. En effet il s'agit d'une surface indiquant des points particuliers, ceux ci sont identifiés a chaque fois par la lettre A (seule) je voudrais remplacer cette lettre par un bloc .
PS je ne dispose pas des expess-Tools.
Merci de votre aide,
lecrabe - 12/7/2010 à 17:50
Hello
Voici la routine que j'utilise de temps en temps pour transformer un point en bloc, un cercle en bloc, un texte en bloc. C la version T2B (Texte en Bloc) que je fournis ci-apres ...
En fait les 3 versions sont dans la meme routine !
Le Decapode
|
;;; Routine pour dessiner un Bloc sur des cercles / points graphiques / textes
;;; Micro-Modif par LeCrabe/LeDecapode
;;;
;;; Version 2 corrigee pour ne traiter que des cercles ou des points ou textes
;;; Commande: C2B ou P2B ou T2B
;;;
;;;--------------------------------------------------------------------;
;;; PNT2BLK.LSP - July 2001 - Original Routine
;;; Place a block object in the location of selected point objects.
;;;--------------------------------------------------------------------;
;;; Function: PNT2BLK --> C2B / P2B / T2B
;;; function to convert point objects to blocks.
;;; block must be defined in the current drawing
;;; blocks including attdefs will not address the attributes
;;; if the block references attdefs with default or constant values,
;;; these will be populated.
;;;*********************************************************************
(defun c:t2b (/ ss ct len e eb bname pt attreqhold echohold)
;(defun c:c2b (/ ss ct len e eb bname pt attreqhold echohold)
;(defun c:p2b (/ ss ct len e eb bname pt attreqhold echohold)
;;;get command echo setting and store it
(setq echohold (getvar "CMDECHO"))
;;;set command echo off
(setvar "CMDECHO" 0)
;;;get attribute request setting and store it
(setq attreqhold (getvar "ATTREQ"))
;;;set attribute request off
(setvar "ATTREQ" 0)
;;;get name of block to insert
(setq bname (getstring "\nBlock name: "))
;;;check that the block is defined in the current drawing
(if (tblsearch "block" bname)
(progn
;;;prompt for point selection
(princ "\nSelect point objects:")
;;; --- if point OR circle OR text objects were selected ---
(if (setq ss (ssget '((0 . "TEXT"))))
;(if (setq ss (ssget '((0 . "CIRCLE"))))
;(if (setq ss (ssget '((0 . "POINT"))))
(progn
;;;walk through point/circle/text objects
(setq len (sslength ss))
(setq ct 0)
(while (< ct len)
;;;for each point
(setq e (ssname ss ct))
(setq ct (+ ct 1))
(setq eb (entget e))
;;;get insert point
(setq pt (cdr (assoc 10 eb)))
;;;insert block
(command "_insert" bname pt "" "" "")
)
)
(princ "\nNo text objects selected.")
;(princ "\nNo circle objects selected.")
;(princ "\nNo point objects selected.")
)
)
(princ "\nInvalid, block not defined in drawing.")
)
;;;restore command echo setting to stored value
(setvar "CMDECHO" echohold)
;;;restore attribute request setting to stored value
(setvar "ATTREQ" 0)
(princ)
)
|
|