vlax with 2002 and r14

Discussion in 'AutoCAD' started by Clive, Aug 14, 2003.

  1. Clive

    Clive Guest

    I have made a program as below
    (defun c:HE ()
    (Graphscr)
    (Setq osnp (Getvar "osmode"))
    (Setq clay (Getvar "clayer"))
    (cOMMAND "-layer" "m" "HEDGE" "c" "GREEN" "" "")

    (setq obj (vlax-ename->vla-object (car (entsel "\npick a spline: "))))
    (setq startParam (vlax-curve-getStartParam obj))
    (sETQ STARTFIRSTPOINT (vlax-curve-getPointAtDist OBJ 0))
    (setq endParam (vlax-curve-getEndParam obj))
    (sETQ ENDFIRSTPOINT (vlax-curve-getPointAtDist OBJ endParam))
    (SETQ IND 2)

    (SETQ
    DISTTOTAL (vlax-curve-getDistAtParam OBJ (- endPARAM startPARAM))
    )
    (sETQ NOOFINS (- (/ DISTTOTAL 2) 1))
    (SETQ NOOFTEXT (FIX NOOFINS))
    (sETQ FIRSTPOINT (vlax-curve-getPointAtDist OBJ IND))
    (Command "-layer" "thaw" "HEDGE" "")
    (Command "-Layer" "s" "HEDGE" "")
    (SETVAR "OSMODE" 0)
    (Command "insert" "HE" STARTFIRSTPOINT "2" "1" FIRSTPOINT)

    (rEPEAT NOOFTEXT
    (sETQ IND (+ IND 2))

    (sETQ NEXTPOINT (vlax-curve-getPointAtDist OBJ IND))

    (Command "insert" "HE" FIRSTPOINT "2" "1" NEXTPOINT)
    (sETQ FIRSTPOINT NEXTPOINT)


    )
    (Command "insert" "HE" FIRSTPOINT "2" "1" ENDFIRSTPOINT)

    (setvar "osmode" osnp)
    (Command "-Layer" "s" CLAY "")
    (Princ startParam)
    (Princ)
    )

    The program works in 2004 but will not work in 2002 and R14
    the nlock is made in all versions

    I says something in 2002 about initilising the VLAX commands

    Any help would be greatfully accepted.


    Regards

    Clive
     
    Clive, Aug 14, 2003
    #1
  2. In 2002 and 2000, you should execute (vl-load-com) prior to calling any
    vl or vlax functions.
     
    Frank Oquendo, Aug 14, 2003
    #2
  3. Clive

    Joe Burke Guest

    Frank,

    Meaning you don't have to (vl-load-com) under A2k4?

    Joe Burke
     
    Joe Burke, Aug 14, 2003
    #3
  4. I've got an A2K4 install that I haven't customized. All vl and vlax
    functions work straight out of the gate. Perhaps they added
    (vl-load-com) to one of the startup files.

    I'll let you know as soon as I can find the damn things.
    <grumble, grumble, grumble>
     
    Frank Oquendo, Aug 14, 2003
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.