Author Topic: Help with vla-get-startpoint  (Read 3447 times)

0 Members and 1 Guest are viewing this topic.

ozimad

  • Guest
Help with vla-get-startpoint
« on: February 08, 2010, 07:07:56 AM »
Hi can somebody helpme with getting startpoint:

Command: ; error: bad argument type: VLA-OBJECT 2127010984 - this is the error

    (setq temp (ssget "l")) ;;;iselect blocj
    (command "_.explode" temp) ;;;i explode it
    (setq temp1 (entlast)) ;;get the line out of block
    (setq objid1 (vla-get-objectid (vlax-ename->vla-object temp1)))
    (setq stpt (vlax-SafeArray->List (vlax-Variant-Value (vla-Get-StartPoint objid1))))
    (print stpt)
    (command "_.erase" temp1 "")

many thanks!




gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Help with vla-get-startpoint
« Reply #1 on: February 08, 2010, 07:23:21 AM »
Hi,

The argument requiered by vla-get-StartPoint have to be a vla-object type, not an ObjectId
Speaking English as a French Frog

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Help with vla-get-startpoint
« Reply #2 on: February 08, 2010, 02:43:19 PM »
Also, you can avoid dealing with variants by using:

Code: [Select]
(vlax-get obj 'StartPoint)

 :wink:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Help with vla-get-startpoint
« Reply #3 on: February 08, 2010, 03:08:05 PM »
One more:
Code: [Select]
(vlax-curve-getstartpoint curve-obj)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Help with vla-get-startpoint
« Reply #4 on: February 08, 2010, 03:20:25 PM »
More cat skinning ( just 'cuz I was in the mood )  :-D :ugly:
Code: [Select]
(
    (lambda ( x )
        (vlax-curve-getPointAtParam
            x
            (vlax-curve-getStartParam x)
        )
    )
    (car (entsel))
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Help with vla-get-startpoint
« Reply #5 on: February 08, 2010, 03:26:18 PM »
Curve functions are the way to go - much quicker with Enames and no need to convert to vla-object...  8-)