Results 1 to 5 of 5

Thread: ActiveX question - Library not registered

  1. #1
    Active Member
    Join Date
    2015-09
    Location
    Québec (Bas-St-Laurent)
    Posts
    90
    Login to Give a bone
    0

    Default ActiveX question - Library not registered

    I'm running ACAD Mechanical 2013, and have lisps dating 10 years that have always worked, until we upgraded to this version. Here's the faulty code (Spline2Pline.lsp (c) 2005 Lloyd Beachy) :

    (Defun C:S2P (/ ss pt# cmdecho osmode clayer count ent lay lng pt-list cnt)
    (vl-load-com)
    (setq ss (ssget '((0 . "spline")))
    pt# (getint "Enter number of segments <100>:")
    cmdecho (getvar "cmdecho")
    osmode (getvar "osmode")
    clayer (getvar "clayer")
    count 0 ;spline counter
    );end setq
    (if(null pt#)(setq pt# 100))
    (setvar "cmdecho" 0)
    (command ".undo" "begin") ;begin undo group
    (setvar "osmode" 0)
    (repeat(sslength ss) ;repeat for each spline
    (setq ent (vlax-ename->vla-object (ssname ss count));change spline to vla-object
    lay (vlax-get-property ent "layer") ;spline's layer *******error happens here*******
    lng (vlax-curve-getDistAtPoint ent(vlax-curve-getEndPoint ent));length of spline
    pt-list(list(vlax-curve-getStartPoint ent)) ;coords for start of spline
    cnt 1.0 ;segment counter
    );end setq
    (repeat pt# ;repeat for each segment
    (setq pt-list(cons(vlax-curve-getPointAtDist ent (* lng(/ cnt pt#)))pt-list));add segment's point to pt-list
    (setq cnt(1+ cnt)) ;counter to next segment
    );end segment repeat
    (setq cnt 0) ;pline counter
    (setvar "clayer" lay) ;match spline's layer
    (command ".pline" ;start "pline" command
    (repeat(length pt-list) ;repeat for each point
    (command(nth cnt pt-list)) ;enter current point
    (setq cnt(1+ cnt)) ;counter to next point
    "" ;return value to close "pline" command
    );end point repeat
    );end command
    (setq count(1+ count)) ;counter to next spline
    );end spline repeat
    (command ".erase" ss "")
    (setvar "osmode" osmode)
    (setvar "clayer" clayer)
    (command ".undo" "end") ;end of undo group
    (setvar "cmdecho" cmdecho)
    (princ) ;exit quietly
    )

    I've isolated the error to the (vlax-get-property ent "layer") line, where I get "; error: ActiveX Server returned an error: Library not registered"

    What does this mean, why haven't I seen this in 7 years and what can I do to get rid of it ?

    Thanks in advance to any and all who help. This is a great tool, BTW. Kudos to M. Beachy for coding it.
    2D or not 2D. There is no question !
    -
    On vient au monde froid, nu et affamé. Après, ça empire.

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    8,483
    Login to Give a bone
    0

    Default Re: ActiveX question - Library not registered

    Did you know you can convert a spline to a polyline using the SPLINEDIT command? This is at least back to 2010.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    All AUGI, all the time Tharwat's Avatar
    Join Date
    2010-06
    Posts
    920
    Login to Give a bone
    0

    Default Re: ActiveX question - Library not registered

    Hi.

    The routine worked nice here on cad 2009 and 2013 , anyway if you are sure that the problem is with that function , so just replace it
    with the following line which means the same result .


    This ...
    Code:
    (vlax-get-property ent "layer")
    with this ..

    Code:
    (vla-get-layer ent )

  4. #4
    Certifiable AUGI Addict irneb's Avatar
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: ActiveX question - Library not registered

    It sounds as if there was some error in your installation. It's not a situation of the com libraries not loaded, else the vlax-ename->vla-object would have failed already. It seems that some AtviceX DLL/OCX/TLB file is not properly registered from the ACad install.

    Perhaps try a repair install or re-install.

    But Opie is correct, for this particular case - that functionality has been added to basic ACad. Which makes that lisp obsolete.
    Knowledge is proportional to experience, but wisdom is inversely proportional to ego!
    My little bit of "wisdom": Hind-sight is useless, unless used to improve the next forethought!

  5. #5
    Active Member
    Join Date
    2015-09
    Location
    Québec (Bas-St-Laurent)
    Posts
    90
    Login to Give a bone
    0

    Default Re: ActiveX question - Library not registered

    Thank you for your replies. I was not aware of the SPLINEDIT command. I've rewritten my routine to accomodate the situation. It is much MUCH simpler.
    I'm sharing my joy and code, if ever someone would be in need of it.

    (defun c:s2p ()
    (setq ss (ssget '((0 . "spline")))
    cmdecho (getvar "cmdecho")
    osmod (getvar "osmode")
    clayer (getvar "clayer")
    count 0 ;spline counter
    )
    (setvar "cmdecho" 0)
    (command ".undo" "begin")
    (setvar "osmode" 0)
    (repeat (sslength ss)
    (command "_.splinedit" (ssname ss count) "P" "" 3)
    (command "_.pedit" (entlast) "F" "")
    (setq count (1+ count))
    )
    (setvar "osmode" osmod)
    (setvar "clayer" clayer)
    (command ".undo" "end")
    (setvar "cmdecho" cmdecho)
    )
    Last edited by Pierre Marcotte; 2012-08-30 at 01:24 PM.
    2D or not 2D. There is no question !
    -
    On vient au monde froid, nu et affamé. Après, ça empire.

Similar Threads

  1. Render Apearance library question
    By tarch in forum Revit Architecture - General
    Replies: 4
    Last Post: 2010-05-20, 06:31 PM
  2. ActiveX Question ....?
    By CADdancer in forum AutoLISP
    Replies: 4
    Last Post: 2010-04-08, 06:33 PM
  3. Replies: 40
    Last Post: 2006-10-16, 05:02 PM
  4. Replies: 4
    Last Post: 2004-07-24, 04:18 AM

Tags for this Thread

Posting Permissions

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