Jump to content

Create Area that updates with moving a dimension


Recommended Posts

Posted

When I run this lisp the first dimension is associative, but not the consecutive ones?

 

(defun c:dimlin ()
(command "layer" "m" "f-dim" "")
(command "dim" "al" "ins" pause "ins" pause pause "" "exit" )
  (SETQ PT NIL)
  (setq newpt nil)
  (SETQ PT (GETPOINT "\nFirst insertion point <enter to exit>:"))
 (while (NOT (NULL PT))
   (setq newpt (osnap pt "ins"))
       (if (NOT (NULL newpt))
       (progn
          (COMMAND "dim" "cont" newPT "" "exit")
   (SETQ newPT NIL)
   );progn
       ;(princ"invalid point pick again--")
       (alert "\nInvalid Point\nPick Another Point")
   );if
       (SETQ PT (GETPOINT"\nNext insertion point <enter to exit>:"))
   
   );while
)

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

  • manddarran

    26

  • Lee Mac

    18

  • alanjt

    13

Posted

Fixed it. (COMMAND "dim" "cont" :?"ins" :oops: newPT "" "exit")

Posted
Command calls should not be used with reactors.

 

I thought they could not be used.:huh:

Posted
I thought they could not be used.:huh:

 

Nope they can't as it wont work. Anyway to force those fields to update on an entity move, or a dimension value change?

Posted
Nope they can't as it wont work. Anyway to force those fields to update on an entity move, or a dimension value change?

That's what I thought.

 

 

99% of fields will update on a regen.

 

eg.

(vla-Regen (vla-get-ActiveDocument
            (vlax-get-Acad-Object)
          )
          acActiveViewport
)

Posted
That's what I thought.

 

 

99% of fields will update on a regen.

 

eg.

(vla-Regen (vla-get-ActiveDocument
            (vlax-get-Acad-Object)
          )
          acActiveViewport
)

 

"99% of fields will update on a regen." You my friend are a genius as well!

Posted
"99% of fields will update on a regen." You my friend are a genius as well!

 

If only that were true. :)

Good luck.

Posted
You knew what I meant :glare:

 

Honestly, I thought you were trying to advise against their use.

Posted
Honestly, I thought you were trying to advise against their use.

 

That was what I interpreted it as, but I couldn't get it to work so I assumed it would not...

Posted
You knew what I meant :glare:

 

Honestly, I thought you were trying to advise against their use.

I assumed you knew/figured out something I didn't. Hell, the only reason I know is because I tried it in an early reactor I did.

Posted
Just sounded like you were being picky is all

 

I meant nothing against you. Like I said, I thought perhaps you had figured out that one could use command calls but were advising against it anyway. There's a big difference between could and should.

  • 4 weeks later...
Posted

Well for some reason I can't get the lisp to work on this new file.

 

I keep getting "** Error: bad argument type: consp #

 

But I am not attached to any polyline.

 

I have attached the version that was working...

 

I just tried it on my other drawing and it works just fine. The dims are associated on both and dimassoc is the same.

headspacing.lsp

Posted

I have finally fixed it. Attached is the working copy as well as the block that it uses.

hs.lsp

farea.dwg

Posted

I am trying to modify the routine so that it doesn't require me it hit enter after I select two dimensions, but I can't get around the vla code here

 

 ;Using snip LeeMac's code.
(princ "\nSelect Dimensions to Retrieve Total Area... ")
 (if (ssget '((0 . "DIMENSION")))
   (progn
     (setq uFlag (not (vla-StartUndoMark
                        (setq doc (vla-get-ActiveDocument
                                    (vlax-get-acad-object))))))

     (vlax-for obj  (setq ss (vla-get-ActiveSelectionSet doc))
       (setq Ids (cons (GetObjectID obj) Ids)))
     (getcount)
     (vla-delete ss)

The (setq ss (vla-get-ActiveSelectionSet doc)) gets me everytime when I try to create a selection set this way :

 

    (while (not(setq ssn (ssget "_:S" '((0 . "Dimension")(102 . "{ACAD_REACTORS"))))))
   (setq ent (car (entsel)))
   (setq ssn (ssadd ent ssn))
   (setq ss2 ssn)
   
   (setq ss (AT:SS->List ssn T))

using

 

;;; Convert selection set to list of ename or vla objects
;;; #Selection - SSGET selection set
;;; #VLAList - T for vla objects, nil for ename
;;; Alan J. Thompson, 04.20.09
(defun AT:SS->List (#Selection #VlaList / #List)
 (and #Selection
      (setq #List (vl-remove-if
                    'listp
                    (mapcar 'cadr (ssnamex #Selection))
                  ) ;_ vl-remove-if
      ) ;_ setq
      #VlaList
      (setq #List (mapcar 'vlax-ename->vla-object #List))
 ) ;_ and
 #List
) ;_ defun

I just get errors. This isn't brain surgery but for the life of me I can't get it to work. I just want to be able to select two dimensions and then a point and it inserts the data.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...