Results 1 to 7 of 7

Thread: Entmake UCS

  1. #1
    Member
    Join Date
    2005-05
    Posts
    38
    Login to Give a bone
    0

    Unhappy Entmake UCS

    How do you entmake a UCS?

    I have tried many variations, but none work:

    (entmake '((0 . "UCS") (2 . "Test 4") (70 . 0) (10 81.6946 16.0317 0.0) (11 0.95056 0.310541 0.0) (12 -0.310541 0.95056 0.0) (79 . 0) (146 . 0.0)))

    (entmake '((0 . "UCS") (2 . "Test 4") (70 . 0) (10 81.6946 16.0317 0.0) (11 0.95056 0.310541 0.0) (12 -0.310541 0.95056 0.0) (79 . 0) (146 . 0.0)))

    (entmake '((100 . "AcDbUCSTableRecord") (0 . "UCS") (2 . "Test 4") (10 81.6946 16.0317 0.0) (11 0.95056 0.310541 0.0) (12 -0.310541 0.95056 0.0) (146 . 0.0)))

    (entmake '((0 . "UCS") (2 . "Test 4") (10 81.6946 16.0317 0.0) (11 0.95056 0.310541 0.0) (12 -0.310541 0.95056 0.0) (146 . 0.0)))

    etcetera etcetera etcetera....

  2. #2
    All AUGI, all the time
    Join Date
    2015-12
    Location
    Central Oregon
    Posts
    591
    Login to Give a bone
    0

    Default Re: Entmake UCS

    This worked for me:
    Code:
    (entmake '((0 . "UCS") (100 . "AcDbSymbolTableRecord") (100 . "AcDbUCSTableRecord")
    	   (2 . "test") (70 . 0) (10 7.61537 9.4732 0.0) (11 0.516992 0.85599 0.0)
    	   (12 -0.85599 0.516992 0.0) (79 . 0) (146 . 0.0)))

  3. #3
    100 Club intergrupocr's Avatar
    Join Date
    2006-02
    Posts
    116
    Login to Give a bone
    0

    Default Re: Entmake UCS

    Did you try the Visual Lisp way?


    An example:

    Code:
     
    (defun ucsadd (name / acaddoc ucss item)
      (vl-load-com)
      (setq acaddoc (vla-get-activedocument (vlax-get-acad-object)))
      (setq ucss (vla-get-UserCoordinateSystems acaddoc))
      (setq item (vla-add ucss
    		(vlax-3d-point '(0.0 0.0 0.0)) ;;origin
    		(vlax-3d-point '(1.0 0.0 0.0)) ;;x axis
    		(vlax-3d-point '(0.0 1.0 0.0)) ;;y axis
    		name 									  ;;name
    	  ) ;_ end of vla-add
      ) ;_ end of setq
      (princ)
    ) ;_ end of defun
    If you type (ucsadd "test4") you will have a new ucs called test 4. I change the values you give because x and y values are not perpendicular and makes an error:

    error: Automation Error. UCS X axis and Y axis are not perpendicular.

  4. #4
    Member
    Join Date
    2005-05
    Posts
    38
    Login to Give a bone
    0

    Default Re: Entmake UCS

    Sorry, but I dont speak VL...
    Thanks tho

    Quote Originally Posted by intergrupocr
    Did you try the Visual Lisp way?

    ....

  5. #5
    Member
    Join Date
    2005-05
    Posts
    38
    Login to Give a bone
    0

    Default Re: Entmake UCS

    Ur a genius!
    I NEVER would have guessed that. How do i figure that out? Guesswork? Is it in the ACAD Help file, because I could not find it.
    I was taking the data I got from tblnext and trying to turn around and use it for entmake...


    Quote Originally Posted by miff
    This worked for me:
    Code:
    (entmake '((0 . "UCS") (100 . "AcDbSymbolTableRecord") (100 . "AcDbUCSTableRecord")
    	   (2 . "test") (70 . 0) (10 7.61537 9.4732 0.0) (11 0.516992 0.85599 0.0)
    	   (12 -0.85599 0.516992 0.0) (79 . 0) (146 . 0.0)))

  6. #6
    All AUGI, all the time
    Join Date
    2015-12
    Location
    Central Oregon
    Posts
    591
    Login to Give a bone
    0

    Default Re: Entmake UCS

    Quote Originally Posted by eagledon
    Ur a genius!
    I NEVER would have guessed that. How do i figure that out? Guesswork? Is it in the ACAD Help file, because I could not find it.
    I was taking the data I got from tblnext and trying to turn around and use it for entmake...
    Aw shucks!
    Nope, I don't like guessing.....first I listed what is stored in the UCS Table for an existing UCS...which is what you were trying to do but (tblsearch) only returns SOME of the entity list, (entget (tblobjname ......)) get the WHOLE enchilada:
    Code:
    Command: (setq ent (entget (tblobjname "UCS" "sbd")))
    ((-1 . <Entity name: 400bfe58>) (0 . "UCS") (330 . <Entity name: 400bfc38>) (5 
    . "7B") (100 . "AcDbSymbolTableRecord") (100 . "AcDbUCSTableRecord") (2 . 
    "sbd") (70 . 0) (10 7.61537 9.4732 0.0) (11 0.516992 0.85599 0.0) (12 -0.85599 
    0.516992 0.0) (79 . 0) (146 . 0.0))
    Then I stripped out the stuff I know isn't used, such as <ename> & handle, and changed the name to "test". Then I tried (entmake) with that list and yep, it worked.

  7. #7
    All AUGI, all the time
    Join Date
    2015-12
    Location
    Central Oregon
    Posts
    591
    Login to Give a bone
    0

    Default Re: Entmake UCS

    Oh, and the help does mention needing whatever group 100 codes are required to define the object:
    For entity types introduced in AutoCAD Release 13 and later releases, you must also specify subclass markers (DXF group code 100) when creating the entity. All AutoCAD entities have the AcDbEntity subclass marker, and this must be explicitly included in the entmake list. In addition, one or more subclass marker entries are required to identify the specific sub-entity type. These entries must follow group code 0 and must precede group codes that are specifically used to define entity properties in the entmake list. For example, the following is the minimum code required to entmake an MTEXT entity: ....
    and with the DXF reference you can see that all Table objects use the 100 . "AcDbSymbolTable" and te UCS in particular uses 100 . "AcDbUCSTableRecord"

Similar Threads

  1. Entmake UCS - error
    By krkeec763189 in forum AutoLISP
    Replies: 4
    Last Post: 2011-11-19, 09:09 AM
  2. entmake
    By gagage in forum AutoLISP
    Replies: 12
    Last Post: 2010-08-12, 06:39 PM
  3. Help with entmake syntax
    By fclao in forum AutoLISP
    Replies: 1
    Last Post: 2010-05-25, 09:12 AM
  4. Example of EntMake
    By ccowgill in forum AutoLISP
    Replies: 8
    Last Post: 2009-08-24, 08:37 PM
  5. UCS vs entmake
    By scwegner in forum AutoLISP
    Replies: 5
    Last Post: 2005-08-26, 04:04 AM

Posting Permissions

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