+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 25
  1. #11
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,041

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by aaryan View Post
    @Mircea Thanks for the favor
    No problem!
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  2. #12
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,162

    Default

    Quote Originally Posted by aaryan View Post
    Thanks
    I actually wanted you to modify your code and not me because you all are masters..
    Master I'm not, but thats nice of you to say, you are too kind
    But you know what? its all you Aaryan.. we're just here to assist and point you in the right direction.

    Cheers

  3. #13
    Senior Member
    Using
    Map 3D 2007
    Join Date
    May 2011
    Location
    autocad
    Posts
    134

    Default

    Thank You So much Mircea and pBe..

    I've checked the code and its working perfectly even for the points selected outside of polyline, but if i pick a point (not on polyline) i am not getting the perpendicular distance. Can you check it please.

  4. #14
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,162

    Default

    If the user did pick a poitn outisde the pline. it will give you intead the distance between the pick point and perpendicular to polyline? is that correct?

    Code:
    (defun c:test3  ()
          (setq a (car (entsel "\nSelect polyline:")))
          (setq pt (getpoint "\nPick point:"))
          (setq dist (if (vlax-curve-getDistAtPoint a pt)
                    (vlax-curve-getDistAtParam a
                       (vlax-curve-getParamAtPoint  a pt))
         (distance (vlax-curve-getClosestPointTo  a pt) pt)))
      (princ (strcat "\nKP on this point is: " (rtos dist 2 3)))
            (princ)
          )

  5. #15
    Senior Member
    Using
    Map 3D 2007
    Join Date
    May 2011
    Location
    autocad
    Posts
    134

    Default

    Not only the distance between a point picked and a point perpendicular to polyline but also the KP from a point which is perpendicular to polyline.

    Like
    Code:
    (princ (strcat "\nKp on this point is:" "xyz" "and offset from route is:abc"))
    and offset could be positive and negative that means if my point picked is on right side it would be positive offset and if it is on left side then it would be negative.

  6. #16
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,041

    Default

    I think that you will get that result by combining the code examples given by pBe and me - it will be a good exercise for you.
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  7. #17
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,162

    Default

    Quote Originally Posted by MSasu View Post
    I think that you will get that result by combining the code examples given by pBe and me - it will be a good exercise for you.
    Thats not a bad idea. I concur.
    Go for it Aaryan.


    I need an aspirin

  8. #18
    Senior Member
    Using
    Map 3D 2007
    Join Date
    May 2011
    Location
    autocad
    Posts
    134

    Default

    OK this will be my work...
    anyways my problem is solved now.
    I appreciate both of YOUR WORK and HELP for me.
    I will come again with another question and another topic.

    Thanks and Best Regards
    Aaryan.

  9. #19
    Forum Deity pBe's Avatar
    Computer Details
    pBe's Computer Details
    Operating System:
    Windows XP
    Discipline
    Construction
    pBe's Discipline Details
    Discipline
    Construction
    Details
    Camp Construction planning and details
    Using
    AutoCAD 2009
    Join Date
    Apr 2010
    Posts
    2,162

    Default

    Quote Originally Posted by aaryan View Post
    OK this will be my work...
    anyways my problem is solved now.
    Thanks and Best Regards
    Aaryan.
    If you dont mind, share youir code here when you're done Aaryan.

    Keep on coding

  10. #20
    Senior Member
    Using
    Map 3D 2007
    Join Date
    May 2011
    Location
    autocad
    Posts
    134

    Default

    Registered forum members do not see this ad.

    I will definitely share here pBe.

    Regards

Similar Threads

  1. Where to Start?
    By donbosco in forum Autodesk Inventor
    Replies: 4
    Last Post: 14th Jun 2010, 09:42 pm
  2. where do i start
    By itsmeagain in forum AutoCAD Beginners' Area
    Replies: 17
    Last Post: 4th Nov 2009, 07:30 pm
  3. Where Do I Start?
    By parkpointer in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 1st Jan 2007, 10:42 pm
  4. Where to start?
    By Random1 in forum Autodesk Inventor
    Replies: 2
    Last Post: 29th Mar 2006, 07:36 pm

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