Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: vlr-dwg-reactor issue MY FIRST REACTOR

  1. #1
    Member
    Join Date
    2013-08
    Posts
    46
    Login to Give a bone
    0

    Default vlr-dwg-reactor issue MY FIRST REACTOR

    Below is my code that I am working on. Everything works good by there selves, but when I put it together and try and utilize a reactor I cant seem to get it to work. I am trying to get the reactor to call the areas function when a save is issued. Then it should update everything. It works if I do everything manually by calling the areas command and then hitting the save button. Can someone please give me some direction here. Thanks.

    Code:
    (setq PLANPATH2 (getvar "DWGPREFIX"))
    (setq DATAFILENAME2 "Areadata.txt")
    (setq ardt (strcat planpath2 datafilename2))
    (setq found2 (findfile ardt))
    
    
      (if (/= found2 ardt)
        (progn     
        (alert "AREAS NOT SETUP")
      (princ)
        )
      )
    
    
      (if (= found2 ardt)
       (progn
        (setq fo2 (open ardt "r"))
        (setq sft1 (atof(read-line fo2)))
        (setq sft2 (atof(read-line fo2)))
        (setq cft1 (atof(read-line fo2)))
        (setq cft2 (atof(read-line fo2)))
        (setq deductft (atof(read-line fo2)))
        (setq garft (atof(read-line fo2)))
        (setq ssft (atof(read-line fo2)))
        (setq deckft (atof(read-line fo2)))
        (setq cpft (atof(read-line fo2)))
        (setq nssft (atof(read-line fo2)))
        (setq unfinft (atof(read-line fo2)))
        (setq carportft (atof(read-line fo2)))
        (setq basementft (atof(read-line fo2)))
        (close fo2)
      )
    )
    
    
    (vl-load-com)
    
    
    (vlr-dwg-reactor nil '((:vlr-beginSave . AREAS)))
    
    
    (defun AREAS ()
      
      (defun FilterClrNumbX(eset valu)
        (setq valu(atoi valu) layerList(list))
        (setq tbl(tblnext "LAYER" T))
        (if(= valu (cdr(assoc 62 tbl)))
          (setq layerList(append layerList (list (cdr(assoc 2 tbl)))))
        )
        (while(setq tbl(tblnext "LAYER"))
          (if(= valu (cdr(assoc 62 tbl)))
            (setq layerList(append layerList (list (cdr(assoc 2 tbl)))))
          )
        )
        (setq cntr 0 newSet(ssadd))
        (while(< cntr (sslength eset))
          (setq en(ssname eset cntr))
          (setq enlist(entget en))
          (if (assoc 62 enlist)
            (if(= valu (cdr(assoc 62 enlist)))
              (ssadd en newSet)
            )
            (if(member (cdr(assoc 8 enlist)) layerList)
              (ssadd en newSet)
            )
          )
          (setq cntr(+ cntr 1))
        )
        newSet
      )
    
    
      (defun FilterLayNameX(eset valu)
        (setq cntr 0 newSet(ssadd))
        (while(< cntr (sslength eset))
          (setq en(ssname eset cntr))
          (setq enlist(entget en))
          (if(= valu (cdr(assoc 8 enlist)))
            (ssadd en newSet)
          )
          (setq cntr(+ cntr 1))
        )
        newSet
      )
    
      (setvar "cmdecho" 0)
      
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "5")))  
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
    
          (setq cntr 0)
    
          (while(< cntr (sslength eset))
    
            (setq en(ssname eset cntr))
    
            (setq sft1(getArea en))
    
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "164")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq sft2(getArea en))
              
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))  
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "3")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq cft1(getArea en))
              
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "84")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
    
          (while(< cntr (sslength eset))
    
            (setq en(ssname eset cntr))
    
            (setq cft2(getArea en))
    
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "9")))  
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq deductft(getArea en))
              
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "1")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq garft(getArea en))
              
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "6")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq ssft(getArea en))
              
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))  
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "30")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq deckft(getArea en))
              
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "7")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq cpft(getArea en))
              
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "8")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq nssft(getArea en))
              
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "3")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq unfinft(getArea en))
              
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "11")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq carportft(getArea en))
              
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "2")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq basementft(getArea en))
              
            (setq cntr(+ cntr 1))
          )
        )
      )
    
    
      (setq fo3 (open ardt "w"))
            (princ sft1 fo3)
            (princ "\n" fo3)
            (princ sft2 fo3)
            (princ "\n" fo3)
            (princ cft1 fo3)
            (princ "\n" fo3)
            (princ cft2 fo3)
            (princ "\n" fo3)
            (princ deductft fo3)
            (princ "\n" fo3)
            (princ garft fo3)
            (princ "\n" fo3)
            (princ ssft fo3)
            (princ "\n" fo3)
            (princ deckft fo3)
            (princ "\n" fo3)
            (princ cpft fo3)
            (princ "\n" fo3)
            (princ nssft fo3)
            (princ "\n" fo3)
            (princ unfinft fo3)
            (princ "\n" fo3)
            (princ carportft fo3)
            (princ "\n" fo3)
            (princ basementft fo3)
            (princ)
      (close fo3)
    
      (setvar "cmdecho" 1)
    
      (princ)
    )

  2. #2
    Member
    Join Date
    2013-08
    Posts
    46
    Login to Give a bone
    0

    Default Re: vlr-dwg-reactor issue MY FIRST REACTOR

    Can anyone help me with this?

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

    Default Re: vlr-dwg-reactor issue MY FIRST REACTOR

    Do you have the getarea routine mentioned in your code for us to review? If this routine is calling the area command, that may be your problem.

    You are also repeating a lot of code that appears to be doing the same thing based on different values. This could be made into a sub-routine.
    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

  4. #4
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: vlr-dwg-reactor issue MY FIRST REACTOR

    I found this example of an editor reactor not dwg reactor to monitor a save.

    It has two arguments, the callback reactor and a list that includes a database object and the name of the file to be saved.

    Your code does't have any arguments in the reactor callback function

    (defun AREAS (callback lstItems) would probably work.

    The code below works.

    Peter

    Code:
    (defun BeginSave (objReactor lstDataBaseAndName) 
     (textscr)
     (print objReactor)
     (print lstDataBaseAndName)
    )
    (if (not rxnBeginSave)
     (setq rxnBeginSave (vlr-editor-reactor nil   '((:vlr-beginsave . BeginSave ))))
    )
    AutomateCAD

  5. #5
    Member
    Join Date
    2013-08
    Posts
    46
    Login to Give a bone
    0

    Default Re: vlr-dwg-reactor issue MY FIRST REACTOR

    Sorry I copied over the wrong code. I copied over the one with out the getarea function. here is the function below. It goes right under the areas function beginning.

    Code:
      (setq addAreTotal 0)
     
      (defun getArea(en / areaT)
        (setvar "cmdecho" 0)
        (setq areaT "0")
        (command "area" "Object"  en)
        (setq areaT(getvar "area"))
        (setvar "cmdecho" 1)
        areaT
      )

  6. #6
    Member
    Join Date
    2013-08
    Posts
    46
    Login to Give a bone
    0

    Default Re: vlr-dwg-reactor issue MY FIRST REACTOR

    Peter that code works Thanks. But it will only work once per session.

  7. #7
    Member
    Join Date
    2013-08
    Posts
    46
    Login to Give a bone
    0

    Default Re: vlr-dwg-reactor issue MY FIRST REACTOR

    Well Peter it appears that it only worked the first time. Not sure what is going on. I can't seem to make it repeat.

  8. #8
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: vlr-dwg-reactor issue MY FIRST REACTOR

    Quote Originally Posted by treaves04413213 View Post
    Well Peter it appears that it only worked the first time. Not sure what is going on. I can't seem to make it repeat.
    The code I supplied works for me.

    There are two parts, the first code is the callback function and the second is the initialization of the reactor.

    I would have to see how you added it to your routine to see why it is only running once.

    The initialization routine should only run once in an editing session. The reactor should run every time you save.
    AutomateCAD

  9. #9
    Member
    Join Date
    2013-08
    Posts
    46
    Login to Give a bone
    0

    Default Re: vlr-dwg-reactor issue MY FIRST REACTOR

    Below is my current code. I have tried it every way I could think of with no success.

    Code:
    (setq PLANPATH2 (getvar "DWGPREFIX"))
    (setq DATAFILENAME2 "Areadata.txt")
    (setq ardt (strcat planpath2 datafilename2))
    (setq found2 (findfile ardt))
    
      (if (/= found2 ardt)
        (progn     
    	(alert "AREAS NOT SETUP")
      (princ)
        )
      )
    
      (if (= found2 ardt)
       (progn
        (setq fo2 (open ardt "r"))
    	(setq sft1 (atof(read-line fo2)))
    	(setq sft2 (atof(read-line fo2)))
    	(setq cft1 (atof(read-line fo2)))
    	(setq cft2 (atof(read-line fo2)))
    	(setq deductft (atof(read-line fo2)))
    	(setq garft (atof(read-line fo2)))
    	(setq ssft (atof(read-line fo2)))
    	(setq deckft (atof(read-line fo2)))
    	(setq cpft (atof(read-line fo2)))
    	(setq nssft (atof(read-line fo2)))
    	(setq unfinft (atof(read-line fo2)))
    	(setq carportft (atof(read-line fo2)))
    	(setq basementft (atof(read-line fo2)))
        (close fo2)
      )
    )
    
    (vl-load-com)
    
    
    (defun AREAS (callback lstItems) 
    
      (setq addAreTotal 0)
     
      (defun getArea(en / areaT)
        (setvar "cmdecho" 0)
        (setq areaT "0")
        (command "area" "Object"  en)
        (setq areaT(getvar "area"))
        (setvar "cmdecho" 1)
        areaT
      )
    
      (defun FilterClrNumbX(eset valu)
        (setq valu(atoi valu) layerList(list))
        (setq tbl(tblnext "LAYER" T))
        (if(= valu (cdr(assoc 62 tbl)))
          (setq layerList(append layerList (list (cdr(assoc 2 tbl)))))
        )
        (while(setq tbl(tblnext "LAYER"))
          (if(= valu (cdr(assoc 62 tbl)))
            (setq layerList(append layerList (list (cdr(assoc 2 tbl)))))
          )
        )
        (setq cntr 0 newSet(ssadd))
        (while(< cntr (sslength eset))
          (setq en(ssname eset cntr))
          (setq enlist(entget en))
          (if (assoc 62 enlist)
            (if(= valu (cdr(assoc 62 enlist)))
              (ssadd en newSet)
            )
            (if(member (cdr(assoc 8 enlist)) layerList)
              (ssadd en newSet)
            )
          )
          (setq cntr(+ cntr 1))
        )
        newSet
      )
    
      (defun FilterLayNameX(eset valu)
        (setq cntr 0 newSet(ssadd))
        (while(< cntr (sslength eset))
          (setq en(ssname eset cntr))
          (setq enlist(entget en))
          (if(= valu (cdr(assoc 8 enlist)))
            (ssadd en newSet)
          )
          (setq cntr(+ cntr 1))
        )
        newSet
      )
    
      (setvar "cmdecho" 0)
      
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE")))) 
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "5")))   
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq sft1(getArea en))
    	      
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "164")))   
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq sft2(getArea en))
    	      
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))  
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "3")))     
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
        
            (setq cft1(getArea en))
    	      
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "84")))    
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
    
            (setq en(ssname eset cntr))
    
            (setq cft2(getArea en))
    
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "9")))     
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
    
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq deductft(getArea en))
    	      
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))  
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "1")))   
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq garft(getArea en))
    	      
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "6")))    
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
    
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
    
            (setq ssft(getArea en))
    
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "30")))    
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
    
            (setq deckft(getArea en))
    
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "7"))) 
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
    
          (while(< cntr (sslength eset))
    
            (setq en(ssname eset cntr))
    
            (setq cpft(getArea en))
    
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE")))) 
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "8")))   
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
          
            (setq nssft(getArea en))
    	      
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE")))) 
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "3")))   
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
    
            (setq unfinft(getArea en))
    	      
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE"))))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "11")))
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
          
          (while(< cntr (sslength eset))
          
            (setq en(ssname eset cntr))
    
            (setq carportft(getArea en))
    	      
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq eset(ssget "X" (list(cons 0 "LWPOLYLINE")))) 
      (if(and eset(> (sslength eset) 0))(setq eset(FilterClrNumbX eset "2")))  
      (if(and eset(> (sslength eset) 0))(setq eset(FilterLayNameX eset "1-AREA-BS")))
      (if (and eset (> (sslength eset) 0))
       (progn
          
          (setq cntr 0)
    
          (while(< cntr (sslength eset))
    
            (setq en(ssname eset cntr))
    
            (setq basementft(getArea en))
    
            (setq cntr(+ cntr 1))
          )
        )
      )
    
      (setq fo3 (open ardt "w"))
    		(princ sft1 fo3)
    		(princ "\n" fo3)
    		(princ sft2 fo3)
    		(princ "\n" fo3)
    		(princ cft1 fo3)
    		(princ "\n" fo3)
    		(princ cft2 fo3)
    		(princ "\n" fo3)
    		(princ deductft fo3)
    		(princ "\n" fo3)
    		(princ garft fo3)
    		(princ "\n" fo3)
    		(princ ssft fo3)
    		(princ "\n" fo3)
    		(princ deckft fo3)
    		(princ "\n" fo3)
    		(princ cpft fo3)
    		(princ "\n" fo3)
    		(princ nssft fo3)
    		(princ "\n" fo3)
    		(princ unfinft fo3)
    		(princ "\n" fo3)
    		(princ carportft fo3)
    		(princ "\n" fo3)
    		(princ basementft fo3)
    		(princ)
      (close fo3)
    
      (setvar "cmdecho" 1)
    
      (princ)
    )
    (if (not rxnBeginSave)
     (setq rxnBeginSave (vlr-editor-reactor nil '((:vlr-beginsave . AREAS ))))
    )

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

    Default Re: vlr-dwg-reactor issue MY FIRST REACTOR

    You should not be using the command function within a reactor. Since you are selecting LWPOLYLINEs, you could check to see if they are closed and then get the area.
    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

Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 2009-08-14, 01:05 PM
  2. Looking for reactor help
    By d_m_hopper in forum AutoLISP
    Replies: 1
    Last Post: 2008-12-17, 07:28 PM
  3. Help With Reactor...!
    By CADdancer in forum AutoLISP
    Replies: 3
    Last Post: 2008-07-11, 05:36 PM
  4. Status Bar Reactor
    By dkh007.66346 in forum AutoLISP
    Replies: 8
    Last Post: 2005-06-24, 11:38 AM
  5. Reactor help?
    By kieren in forum AutoLISP
    Replies: 1
    Last Post: 2004-09-08, 11:37 AM

Posting Permissions

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