Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: AutoLisp and Fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Can Lisp, or another method, be used to modify Fields in Sheetset etc. I'd like to modify or update dates, text, and revision fields within several large drawing packages which use Sheetsets, is this possible, what would be the best tool / method to use?
Thanks ! ! !
Re: AutoLisp and Fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
why is not working?
(vl-load-com) (defun c:Test (/ space ss pt) ; Tharwat 14. 06. 2011 (setq space (vla-get-modelspace (vla-get-ActiveDocument (vlax-get-acad-object)) ) ) (if (and (setq ss (car (entsel "\n Select a Dimension : "))) (setq pt (getpoint "\n Specify Text Location :")) ) (vla-addMText space (vlax-3d-point pt) 4. (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa (vla-get-ObjectID (vlax-ename->vla-object ss))) ">%)Area \f "%lu2%pr2%ps[, m²]%ct8[0.0001]">%" ) ) (princ) ) (princ) )
Thanks!
Re: AutoLisp and Fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
may be u need to add slash before quotes
something liske that :
"%<\AcObjProp Object(%<\_ObjId "
(itoa (vla-get-ObjectID (vlax-ename->vla-object ss)))
">%).Area \f \"%lu2\">%
Re: AutoLisp and Fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Gustavo_Bernardi wrote:why is not working?
Thanks!
(strcat "%<\\AcObjProp.16.2 Object(%<\\_ObjId " (itoa (vla-get-ObjectID (vlax-ename->vla-object ss))) ">%).Area \\f \"%lu2%pr2%ps[,m²]\">%" )
HTH
Re: AutoLisp and Fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
nothing yet ...
I need to measure the area that is in centimeters and put text in square meters. It would be great if you could put the unit at the end of the text (m2).
Thanks for now
Re: AutoLisp and Fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Gustavo_Bernardi wrote:nothing yet ...
I need to measure the area that is in centimeters and put text in square meters. It would be great if you could put the unit at the end of the text (m2).
Thanks for now
Nothing happens? no prompt for text location or no text at all? whats the error?
sq centimeters to sq meters -- > 15000 = 1.5 ?
64 bit OS?
It would help if you'll give us more info.
Re: AutoLisp and Fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi, yes my OS is 64-bit.
The object selection is no problem, the base point is then asked me the error that appears is this:
"Specify Text Location:, error: bad argument type: nil stringp"
What I did was take the code at the beginning of this topic. So I changed that part of the field by code provided by window creation field with my desired properties.
Yes, what I need is a measure of area with the value 15000 return me the value 1.5
Thanks for your patience
The code works for you?
(vl-load-com) (defun c:Test (/ space ss pt) ; Tharwat 14. 06. 2011 (setq space (vla-get-modelspace (vla-get-ActiveDocument (vlax-get-acad-object)) ) ) (if (and (setq ss (car (entsel "\n Select a Dimension : "))) (setq pt (getpoint "\n Specify Text Location :")) ) (vla-addMText space (vlax-3d-point pt) 4. (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa (vla-get-ObjectID (vlax-ename->vla-object ss))) ">%)Area \f "%lu2%pr2%ps[, m²]%ct8[0.0001]">%" ) ) (princ) ) (princ) )
Re: AutoLisp and Fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Try the attached file
Re: AutoLisp and Fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
The field works well ... thank you
Just wish I could control the width of the text box so that the symbol is not in the second row.
In another lisp that I created, I used the code STRLEN to get the text length (in letters) and multiply by an average width.
I still have to study these VL-something ... I do not understand any of this, I create my lisps only with get--- and command
Thank you for your attention
Re: AutoLisp and Fields
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Gustavo_Bernardi wrote:The field works well ... thank you
Just wish I could control the width of the text box so that the symbol is not in the second row.
In another lisp that I created, I used the code STRLEN to get the text length (in letters) and multiply by an average width.
Thank you for your attention
You are welcome, I will look into that width thingy tommorrow.
Cheers


