See the top rated post in this thread. Click here

Results 1 to 3 of 3

Thread: ductdraw lisp

  1. #1
    I could stop if I wanted to
    Join Date
    2012-11
    Location
    Brisbane, Australia
    Posts
    239
    Login to Give a bone
    1

    Default ductdraw lisp

    Hey guys

    this is a bit of a side project of mine.
    im trying to make a program to draw ducts using some dynamic blocks ive made.
    ive had a fair bit of sucess with it thanks to the help of these forums but ive hit a wall.
    I am trying to input the value of the angle between the 2 ducts into the radial blocks properties but when i do it seems to change.

    Code:
     (setq radangle       (*       (if
                                                (> (angle o_p1 o_p2) (angle p1 p2))
                                                (- (angle o_p1 o_p2) (angle p1 p2))
                                                (- (angle p1 p2) (angle o_p1 o_p2))
                                           )
                                  57.2957795)
     )
    
    
     (command "-insert" "MM_Duct_Radius" p3 "" a2)
      (setq  radblk  (vlax-ename->vla-object (ssname (ssget "L") 0))
       radblkprops  (get-dynprops radblk)
       widthprop  (cdr (assoc "Width" radblkprops))
       angleprop  (cdr (assoc "Radius Angle" radblkprops))
       ssradblk  (ssget "L")
      )
     (vla-put-value angleprop (vlax-make-variant radangle))
     (vla-put-value widthprop (vlax-make-variant (* rd_width 1.0)))
     (vla-regen (vla-get-activedocument (vlax-get-acad-object)) AcActiveViewport)
    Attached Files Attached Files
    Last edited by RenderMan; 2012-12-06 at 01:57 PM. Reason: Please use [CODE] tags

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: ductdraw lisp

    You might consider the GetDynamicBlockProperties Method... If anything like a dynamic block with Visibility States, you'll want to pay attention to the AllowedValues Property (not sure).
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    I could stop if I wanted to
    Join Date
    2012-11
    Location
    Brisbane, Australia
    Posts
    239
    Login to Give a bone
    0

    Default Re: ductdraw lisp

    im not sure if thats the probelm mate. i did a test and the function is grabbing the correct value but when it is placed into the block it changes to another completely different number.
    i checked the dynamic block to make sure there wasnt any constraints that might hinder it and it still puts a different number into the block than the function is spitting out.

    it has me beat...

Similar Threads

  1. Replies: 13
    Last Post: 2014-01-20, 06:14 PM
  2. Replies: 3
    Last Post: 2012-05-07, 08:16 PM
  3. Replies: 9
    Last Post: 2012-01-21, 07:58 AM
  4. non lisp cursor location for lisp getpoint
    By dtuttle in forum AutoLISP
    Replies: 3
    Last Post: 2005-05-10, 11:37 PM

Posting Permissions

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