Results 1 to 10 of 10

Thread: change all Object Area scale

  1. #1
    Login to Give a bone
    0

    Default change all Object Area scale

    Hi,
    I have some dwg file made in UK with wrong scale :

    %<\AcObjProp Object(%<\_ObjId 902950384>%).Area \f "%lu2%pr0">%

    And I want to have the correct field:

    %<\AcObjProp.16.2 Object(%<\_ObjId 902950384>%).Area \f "%lu2%pr0%ps[, m2]%ct8[1.000000000000000E-006]">%

    Can i do that with lisp or vlisp ?

    Daniel OLIVES
    French user

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: change all Object Area scale

    I don't see why not. You should be able to edit the text/mtext and replace the string contents.
    R.K. McSwain | CAD Panacea |

  3. #3
    Login to Give a bone
    0

    Default Re: change all Object Area scale

    Hi,
    Yes I can do that manualy, but I have many object so vlisp would be better.
    Daniel OLIVES

  4. #4
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: change all Object Area scale

    I know.
    You asked if you could do it with lisp and my answer was "I don't see why not"
    R.K. McSwain | CAD Panacea |

  5. #5
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    555
    Login to Give a bone
    0

    Default Re: change all Object Area scale

    Like remark have a go

    Code:
    look for .Area \f "%lu2%pr0">% in mtext
    replace with .Area \f "%lu2%pr0%ps[, m2]%ct8[1.000000000000000E-006]
    Lots of code samples out there to do replace text you use vla-get-textstring and vla-put-textstring.

  6. #6
    Login to Give a bone
    0

    Default Re: change all Object Area scale

    Hi,
    I test :
    Code:
    (defun c:putfield ()
       (vl-load-com)
       (setq elemname (car (entsel "\nMText avec champ: ")))
       ;		<Nom d'entité: b1ca7850>
       (setq elemdata (entget elemname))
       (setq tval (cdr (assoc 1 elemdata)))
       ;		"\\pt9375;SANITAIRES\\P166702475"
       (setq dict (vlax-vla-object->ename (vla-GetExtensionDictionary (vlax-ename->vla-object elemname))))
       ;		<Nom d'entité: b8a7c920>
       (setq flst (entget (cdr (assoc 360 (entget (cdr (last (dictnext dict "ACAD_FIELD"))))))))
       ;   
       (setq fexp (cdr (assoc 2 flst)))
       ;		Valeur lue = "\\AcObjProp Object(%<\\_ObjIdx 0>%).Area \\f \"%lu2%pr0\""
       ;
       ;	%<\AcObjProp Object(%<\_ObjId 2982842160>%).Area \f "%lu2%pr0">%
       ;
       ;	%<\AcObjProp.16.2 Object(%<\_ObjId 2982842160>%).Area \f "%lu2%pr0%ps[, m2]%ct8[1.000000000000000E-005]">%
       ;	%<\AcObjProp.16.2 Object(%<\_ObjId 2982842160>%).Area \f "%lu2%pr0%ps[, m2]%ct8[1.000000000000000E-005]">%
       ;
       ;		223144020.2024
       ;
       (setq newstr "\\AcObjProp.16.2 Object(%<\\_ObjIdx 0>%).Area \\f \"%lu2%pr0%ps[, m2]%ct8[1.000000000000000E-006]\"")
       (setq flst (subst (cons 2 newstr) (assoc 2 flst) flst))
       (entmod flst)
       (setq elemnamevla (vlax-ename->vla-object elemname))
       (vla-put-textstring elemnamevla (vla-fieldcode elemnamevla))
       (princ)
    )
    Just a question how get the ObjId 2982842160 ?

    Daniel OLIVES
    Last edited by peter; 2018-03-21 at 06:28 PM.

  7. #7
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: change all Object Area scale

    Please upload a sample dwg

  8. #8
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: change all Object Area scale

    use it , and then use STRCAT to build the string

    (setq elemdata (entget elemname))
    (setq tval (cdr (assoc 1 elemdata)))
    ; by me
    (setq objectID (vla-get-ObjectID( vlax-ename->vla-object elemname)))
    ;by me

  9. #9
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    0

    Default Re: change all Object Area scale

    Quote Originally Posted by devitg.89838 View Post
    use it , and then use STRCAT to build the string
    You will need to convert ObjectID from an integer to a string to use it in a STRCAT operation.

    BTW, you should use [code][/code] tags around your code instead of [quote][/quote] tags.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  10. #10
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    275
    Login to Give a bone
    0

    Default Re: change all Object Area scale

    Some like it , as Bart Simpson at the black board


    Code:
    here I have to put my code   here I have to put my code   here I have to put my code   here I have to put my code  here I have to put my code   here I have to put my code   here I have to put my code   here I have to put my code     here I have to put my code   here I have to put my code   here I have to put my code   here I have to put my code     here I have to put my code   here I have to put my code   here I have to put my code   here I have to put my code     here I have to put my code   here I have to put my code   here I have to put my code   here I have to put my code     here I have to put my code   here I have to put my code   here I have to put my code   here I have to put my code     here I have to put my code   here I have to put my code   here I have to put my code   here I have to put my code     here I have to put my code   here I have to put my code   here I have to put my code   here I have to put my code     here I have to put my code   here I have to put my code   here I have to put my code   here I have to put my code

Similar Threads

  1. 2016: Hatch Area Error (Selected object does not have an area)
    By syedshanhaider708501 in forum AutoCAD General
    Replies: 1
    Last Post: 2015-09-10, 12:44 PM
  2. Replies: 9
    Last Post: 2015-08-21, 06:33 PM
  3. Additional types of area plans, or an area object with properties.
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 3
    Last Post: 2012-06-14, 07:11 AM
  4. Scale - Change posn not object
    By neilcheshire in forum AutoCAD LT - General
    Replies: 2
    Last Post: 2008-08-05, 02:50 PM
  5. Highlight Selected Object During the Area - Add - Object Command
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2007-05-26, 06:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •