VLisp Mtext Justification Property
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
VLisp Mtext Justification Property

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Chandan
Guest





Posted: Mon Jan 10, 2005 6:17 pm    Post subject: VLisp Mtext Justification Property Reply with quote

How I Set the Justification Property of a Mtext entity, through Visual Lisp.

(setq Obj (vla-addMText *WorkSpace* (vlax-3d-point StartPt) MTextHeight InputString))

(vlax-put-property Obj '?????? MiddleCenter)


Chandan
chandan_augi@hotmail.com

Back to top
MP
Guest





Posted: Mon Jan 10, 2005 7:46 pm    Post subject: Re: VLisp Mtext Justification Property Reply with quote

AlignmentPoint

"Chandan" <nospam@address.withheld> wrote in message
news:11194898.1105363064891.JavaMail.jive@jiveforum2.autodesk.com...
Quote:
How I Set the Justification Property of a Mtext entity, through Visual
Lisp.

(setq Obj (vla-addMText *WorkSpace* (vlax-3d-point StartPt) MTextHeight
InputString))

(vlax-put-property Obj '?????? MiddleCenter)


Chandan
chandan_augi@hotmail.com
Back to top
Chandan
Guest





Posted: Tue Jan 11, 2005 9:29 am    Post subject: Re: VLisp Mtext Justification Property Reply with quote

VLisp Mtext Justification Property “AlignmentPoint” not working.

The flowing error occurs when I execute the syntax:

(vlax-put-property Obj 'AlignmentPoint "MiddleCenter")

; error: ActiveX Server returned the error: unknown name: ALIGNMENTPOINT

Back to top
Chandan
Guest





Posted: Tue Jan 11, 2005 10:06 am    Post subject: Re: VLisp Mtext Justification Property Reply with quote

Sir, please check this function:

;;; Create Any Mtext Entity
(defun CreateMtextEntity (StartPt InputString MTextHeight MTextWidth MTextJustify MTextLayer / *ModelSpace* Obj)
(if (= (getvar "TILEMODE") 1)
(setq *WorkSpace* (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-Acad-Object))))
(setq *WorkSpace* (vla-get-PaperSpace (vla-get-ActiveDocument (vlax-get-Acad-Object))))
)
(setq Obj (vla-addMText *WorkSpace* (vlax-3d-point StartPt) MTextHeight InputString))
(vlax-put-property Obj 'Height MTextHeight)
(vlax-put-property Obj 'StyleName "STANDARD")
(vlax-put-property Obj 'Layer MTextLayer)
(vlax-put-property Obj 'Lineweight 0)
(vlax-put-property Obj 'Width MTextWidth)
;***** Checking Require *****
(vlax-put-property Obj 'AlignmentPoint MTextJustify) ;***** Checking Require *****
;***** Checking Require *****
(vlax-release-object Obj)
(gc)
)

(defun C:TT ()
(setq Pt (getpoint "Pick a Point: ")
InputString "SECTION WEIGHT FOR DRAWING NO: XXXXXXXXXXXXXXXXXXXXXX"
MTextHeight 5.0
MTextWidth 175.0
MTextJustify "MiddleCenter"
MTextLayer "Layer1")
(CreateMtextEntity Pt InputString MTextHeight MTextWidth MTextJustify MTextLayer)
)

(C:TT)
Back to top
R. Robert Bell
Guest





Posted: Tue Jan 11, 2005 10:11 pm    Post subject: Re: VLisp Mtext Justification Property Reply with quote

Look at the MText object in the ActiveX Reference.

--
R. Robert Bell


"Chandan" <nospam@address.withheld> wrote in message
news:5146941.1105427586988.JavaMail.jive@jiveforum1.autodesk.com...
Sir, please check this function:

;;; Create Any Mtext Entity
(defun CreateMtextEntity (StartPt InputString MTextHeight MTextWidth
MTextJustify MTextLayer / *ModelSpace* Obj)
(if (= (getvar "TILEMODE") 1)
(setq *WorkSpace* (vla-get-ModelSpace (vla-get-ActiveDocument
(vlax-get-Acad-Object))))
(setq *WorkSpace* (vla-get-PaperSpace (vla-get-ActiveDocument
(vlax-get-Acad-Object))))
)
(setq Obj (vla-addMText *WorkSpace* (vlax-3d-point StartPt) MTextHeight
InputString))
(vlax-put-property Obj 'Height MTextHeight)
(vlax-put-property Obj 'StyleName "STANDARD")
(vlax-put-property Obj 'Layer MTextLayer)
(vlax-put-property Obj 'Lineweight 0)
(vlax-put-property Obj 'Width MTextWidth)
;***** Checking Require *****
(vlax-put-property Obj 'AlignmentPoint MTextJustify) ;***** Checking
Require *****
;***** Checking Require *****
(vlax-release-object Obj)
(gc)
)

(defun C:TT ()
(setq Pt (getpoint "Pick a Point: ")
InputString "SECTION WEIGHT FOR DRAWING NO: XXXXXXXXXXXXXXXXXXXXXX"
MTextHeight 5.0
MTextWidth 175.0
MTextJustify "MiddleCenter"
MTextLayer "Layer1")
(CreateMtextEntity Pt InputString MTextHeight MTextWidth MTextJustify
MTextLayer)
)

(C:TT)
Back to top
Jeff Mishler
Guest





Posted: Wed Jan 12, 2005 4:39 am    Post subject: Re: VLisp Mtext Justification Property Reply with quote

Mark led you astray........you want the AttachmentPoint for Mtext objects

--
Jeff
check out www.cadvault.com
"Chandan" <nospam@address.withheld> wrote in message
news:5146941.1105427586988.JavaMail.jive@jiveforum1.autodesk.com...
> Sir, please check this function:
Back to top
MP
Guest





Posted: Wed Jan 12, 2005 9:22 am    Post subject: Re: VLisp Mtext Justification Property Reply with quote

oops sorry
:-\


"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:41e463c9$1_1@newsprd01...
Quote:
Mark led you astray........you want the AttachmentPoint for Mtext objects

--
Jeff
check out www.cadvault.com
"Chandan" <nospam@address.withheld> wrote in message
news:5146941.1105427586988.JavaMail.jive@jiveforum1.autodesk.com...
Sir, please check this function:

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB