Author Topic: Problems with vlax-curve-getPointAtDist  (Read 2617 times)

0 Members and 1 Guest are viewing this topic.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Problems with vlax-curve-getPointAtDist
« on: November 24, 2015, 03:28:53 AM »
Hello!

I need some guys some can test this method
Code: [Select]
(defun c:xx()
  (setq curve-obj (vlax-ename->vla-object (car (entsel "\m Select Polyline!"))))
  (while (setq p (vlax-curve-getPointAtDist curve-obj (getdist "\n Enter a distance: ")))
    (command-s "_point" p)
    )
  )

My problem is: the method works wrong in my AutoCAD Civil3d 2016 SP1.0 installation
After run command: xx
Select a Polyline and than give some distance values
it should set points exactly after distance value along the Polyline.
In my case it don΄t do that. It sets all points on startpoint from Polyline and random to the endpoint from Polyline.
Have somebody the same result, please give me a call.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Problems with vlax-curve-getPointAtDist
« Reply #1 on: November 24, 2015, 03:36:57 AM »
This is a classic OSMODE issue.
Because you use command calls the OSMODE value has an impact on the end result.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Problems with vlax-curve-getPointAtDist
« Reply #2 on: November 24, 2015, 04:32:07 AM »
This is a classic OSMODE and/or SNAPMODE issue.

Because you use command calls the OSMODE and SNAPMODE values may have an impact on the end result.

Save their values, set them to 0 before executing your command calls, restoring their original values when done.

This/Fixed. :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Problems with vlax-curve-getPointAtDist
« Reply #3 on: November 24, 2015, 04:47:35 AM »
Oh thank you, I thougt I have done it in my program I use this method.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Problems with vlax-curve-getPointAtDist
« Reply #4 on: November 24, 2015, 05:19:55 AM »
@ MP: I am not seeing this issue with SNAPMODE. Note: I use BricsCAD.

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Problems with vlax-curve-getPointAtDist
« Reply #5 on: November 24, 2015, 05:30:23 AM »
Easiest fix would be:
Code: [Select]
(command-s "_.point" "_non" (trans p 0 1))
Or better, use entmake:
Code: [Select]
(entmake (list '(0 . "POINT") (cons 10 p)))

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Problems with vlax-curve-getPointAtDist
« Reply #6 on: November 24, 2015, 06:13:56 AM »
Perfect, thanx Lee!

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Problems with vlax-curve-getPointAtDist
« Reply #7 on: November 24, 2015, 10:57:38 AM »
@ MP: I am not seeing this issue with SNAPMODE. Note: I use BricsCAD.

You're correct, I should never post in the middle of the night when messed up from insomnia. You'd think I'd know that after all these years ... apologies for the tangent. Leaving errant post intact for thread continuity.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.com • http://cadanalyst.slack.com • http://linkedin.com/in/cadanalyst