🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.cad
Article #53219

Re: [Acad] [Lisp] Wstawienie tekstu

#53219
From: PiotrB.
Date: Sat, 14 Nov 2009 13:58
40 lines
1981 bytes
Dnia 14-11-2009 o 01:04:40 szadok <szadok375@terramail.pl> napisał(a):

musisz sprawdzić czy aktualny styl tekstu ma niezerową wysokość.
a najlepiej użyć VBA np.:


Sub textadd()
   Dim textString, insertionPoint, height
   Dim text As AcadText

   textString = ThisDrawing.Utility.GetString(True, "Wpisz tekst: ")
   insertionPoint = ThisDrawing.Utility.GetPoint(, "Wskaż punkt wstawienia:  
")
   height = ThisDrawing.Utility.GetDistance(insertionPoint, "Podaj wysokość  
tekstu: ")

   Set text = ThisDrawing.ModelSpace.AddText(textString, insertionPoint,  
height)
End Sub

lub z mtext:

Sub mtextadd()
   Dim textString, insertionPoint, height, width
   Dim text As AcadMText

   textString = ThisDrawing.Utility.GetString(True, "Wpisz tekst: ")
   insertionPoint = ThisDrawing.Utility.GetPoint(, "Wskaż punkt wstawienia:  
")

   Set text = ThisDrawing.ModelSpace.AddMText(insertionPoint, 0, textString)

   height = ThisDrawing.Utility.GetDistance(insertionPoint, "Podaj wysokość  
tekstu: ")
   text.height = height

   width = ThisDrawing.Utility.GetDistance(insertionPoint, "Podaj szerokość  
tekstu: ")
   text.width = width
End Sub
Technical Details
Message-ID: <op.u3d03ez0fjrr5n@piotrb-67c57c10>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!news.onet.pl!not-for-mail
References: <slrnhfrt0o.5is.szadok375@haziel.local.domain>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.nask.pl!news.nask.org.pl!news.onet.pl!not-for-mail
From: "PiotrB." <ppqqTowytnij@towytnijop.pl>
Newsgroups: pl.comp.cad
Subject: Re: [Acad] [Lisp] Wstawienie tekstu
Date: Sat, 14 Nov 2009 14:58:16 +0100
Organization: http://onet.pl
Lines: 40
Message-ID: <op.u3d03ez0fjrr5n@piotrb-67c57c10>
References: <slrnhfrt0o.5is.szadok375@haziel.local.domain>
NNTP-Posting-Host: chello089078248003.chello.pl
Mime-Version: 1.0
X-Trace: news.onet.pl 1258207096 3045 89.78.248.3 (14 Nov 2009 13:58:16 GMT)
X-Complaints-To: niusy@onet.pl
NNTP-Posting-Date: Sat, 14 Nov 2009 13:58:16 +0000 (UTC)
User-Agent: Opera Mail/10.00 (Win32)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit