+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Junior Member godofcad's Avatar
    Computer Details
    godofcad's Computer Details
    Operating System:
    xp
    Computer:
    Compaq desktop
    Motherboard:
    mercury
    CPU:
    Intel Pentium
    RAM:
    2gb
    Graphics:
    2GB
    Primary Storage:
    ------
    Monitor:
    view sonic
    Discipline
    Civil
    godofcad's Discipline Details
    Occupation
    surveyed map designing
    Discipline
    Civil
    Using
    AutoCAD 2000i
    Join Date
    Jan 2010
    Location
    india ,karnataka ,udupi
    Posts
    24

    Default How to find Intersection point of DTEXT object

    Registered forum members do not see this ad.

    Grettings ...

    here i have one problem
    I am tryng to put POINTS to selected "DTEXT" objects
    if the DTEXT justification is LEFT then it is working
    ; (setq pos(cdr(assoc 10 (entget(car(entsel)))) ;;;

    but if the DETXT Justification is MiddleRight,MiddleLeft,Topleft etc.
    then its not working i mean its showing worng co-ordinates of DTEXT intersection point

    in "assoc 11" its showing right coordinates ......

    How to solve this problem guys ........ Please help .......





    Instersection point of DTEXT.dwg

  2. #2
    Forum Deity BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    256GB SSD
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Using
    Civil 3D 2015
    Join Date
    Nov 2009
    Posts
    4,685

    Default

    FWIW -

    Code:
    (defun c:FOO  ( / ss oText typ)
      (vl-load-com)
      (princ "\rSelect a text entity: ")
      (if (and (setq ss (ssget ":S:E:L" '((0 . "*TEXT"))))
               (setq oText (vlax-ename->vla-object (ssname ss 0))))
        (progn
          (princ "\n  >>  ")
          (princ
            (cond
              ((vl-position
                 (setq typ (vla-get-objectname oText))
                 '("AcDbMText" "AcDbText"))
               (vlax-get oText 'insertionpoint))
              ((= typ "RText") (vlax-get oText 'position))))
          (terpri))
        (prompt "\n** Nothing selected ** "))
      (princ))
    "Potential has a shelf life." - Margaret Atwood

    Autodesk Exchange Apps
    ~ Autoloader ~ AutoCAD Security

  3. #3
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,819

    Default

    Another:

    Code:
    (defun c:tpt ( / e i s )
        (if (setq s (ssget '((0 . "TEXT,MTEXT"))))
            (repeat (setq i (sslength s))
                (setq e (entget (ssname s (setq i (1- i)))))
                (entmake
                    (list '(0 . "POINT")
                        (cons 10
                            (if (eq "TEXT" (cdr (assoc 0 e)))
                                (if
                                    (or
                                        (/= 0 (cdr (assoc 72 e)))
                                        (/= 0 (cdr (assoc 73 e)))
                                    )
                                    (trans (cdr (assoc 11 e)) (cdr (assoc -1 e)) 0)
                                    (trans (cdr (assoc 10 e)) (cdr (assoc -1 e)) 0)
                                )
                                (cdr (assoc 10 e))
                            )
                        )
                    )
                )
            )
        )
        (princ)
    )
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  4. #4
    Junior Member godofcad's Avatar
    Computer Details
    godofcad's Computer Details
    Operating System:
    xp
    Computer:
    Compaq desktop
    Motherboard:
    mercury
    CPU:
    Intel Pentium
    RAM:
    2gb
    Graphics:
    2GB
    Primary Storage:
    ------
    Monitor:
    view sonic
    Discipline
    Civil
    godofcad's Discipline Details
    Occupation
    surveyed map designing
    Discipline
    Civil
    Using
    AutoCAD 2000i
    Join Date
    Jan 2010
    Location
    india ,karnataka ,udupi
    Posts
    24

    Default

    Quote Originally Posted by RenderMan View Post
    FWIW -

    Code:
    (defun c:FOO  ( / ss oText typ)
      (vl-load-com)
      (princ "\rSelect a text entity: ")
      (if (and (setq ss (ssget ":S:E:L" '((0 . "*TEXT"))))
               (setq oText (vlax-ename->vla-object (ssname ss 0))))
        (progn
          (princ "\n  >>  ")
          (princ
            (cond
              ((vl-position
                 (setq typ (vla-get-objectname oText))
                 '("AcDbMText" "AcDbText"))
               (vlax-get oText 'insertionpoint))
              ((= typ "RText") (vlax-get oText 'position))))
          (terpri))
        (prompt "\n** Nothing selected ** "))
      (princ))


    Renderman ....its not working . if i change text justification Left to Meddle center .its showing the Deferent co-ordinate value ..

  5. #5
    Junior Member godofcad's Avatar
    Computer Details
    godofcad's Computer Details
    Operating System:
    xp
    Computer:
    Compaq desktop
    Motherboard:
    mercury
    CPU:
    Intel Pentium
    RAM:
    2gb
    Graphics:
    2GB
    Primary Storage:
    ------
    Monitor:
    view sonic
    Discipline
    Civil
    godofcad's Discipline Details
    Occupation
    surveyed map designing
    Discipline
    Civil
    Using
    AutoCAD 2000i
    Join Date
    Jan 2010
    Location
    india ,karnataka ,udupi
    Posts
    24

    Default

    @ lee mac u got my point ...and its working perfectly ......

    i got what i need thank u lee your wonderful .....


  6. #6
    Forum Deity BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    256GB SSD
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Using
    Civil 3D 2015
    Join Date
    Nov 2009
    Posts
    4,685

    Default

    Quote Originally Posted by godofcad View Post
    Renderman ....its not working . if i change text justification Left to Meddle center .its showing the Deferent co-ordinate value ..
    Respectfully, it (the code I posted) does exactly what I intended... to return the InsertionPoint, or Position coordinate for AcDBMText, AcDbText, and RText entities respectively.

    Unfortunately, I do not always post code that is exactly tailored for others' purposes, and in this instance I (incorrectly) anticipated that you would modify the code to suite.

    In any event, I am glad that you were able to achieve your goal with Lee's help... I've personally learned a lot from Lee... He's a wise, and today and old(-er) man!

    Cheers, guys!
    "Potential has a shelf life." - Margaret Atwood

    Autodesk Exchange Apps
    ~ Autoloader ~ AutoCAD Security

  7. #7
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,819

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by godofcad View Post
    @ lee mac u got my point ...and its working perfectly ......

    i got what i need thank u lee your wonderful .....

    You're welcome, though I hope you can learn from the method in my code.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

Similar Threads

  1. OSNAP doesn't find intersection of some lines
    By robnad in forum AutoCAD Beginners' Area
    Replies: 21
    Last Post: 22nd Nov 2012, 11:16 pm
  2. How To Find Intersection Point Between Two Crossing LWPOLYLINES
    By godofcad in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 11th Apr 2012, 10:13 am
  3. How to find the XYZ intersection of a line with a 3D Polyline
    By brachiopod in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 14th Sep 2010, 02:45 pm
  4. intersection point
    By salman in forum AutoCAD General
    Replies: 5
    Last Post: 20th Apr 2009, 11:27 am
  5. How to find intersection with extrude?
    By atsay714 in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 2
    Last Post: 12th Apr 2009, 03:23 am

Bookmarks

Posting Permissions

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