manddarran Posted April 14, 2010 Author Posted April 14, 2010 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 ) Quote
manddarran Posted April 14, 2010 Author Posted April 14, 2010 Fixed it. (COMMAND "dim" "cont" :?"ins" newPT "" "exit") Quote
Lee Mac Posted April 15, 2010 Posted April 15, 2010 Command calls should not be used with reactors. Quote
alanjt Posted April 15, 2010 Posted April 15, 2010 Command calls should not be used with reactors. I thought they could not be used. Quote
manddarran Posted April 15, 2010 Author Posted April 15, 2010 I thought they could not be used. Nope they can't as it wont work. Anyway to force those fields to update on an entity move, or a dimension value change? Quote
alanjt Posted April 15, 2010 Posted April 15, 2010 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 ) Quote
manddarran Posted April 15, 2010 Author Posted April 15, 2010 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! Quote
alanjt Posted April 15, 2010 Posted April 15, 2010 "99% of fields will update on a regen." You my friend are a genius as well! If only that were true. Good luck. Quote
Lee Mac Posted April 15, 2010 Posted April 15, 2010 I thought they could not be used. You knew what I meant Quote
alanjt Posted April 15, 2010 Posted April 15, 2010 You knew what I meant Honestly, I thought you were trying to advise against their use. Quote
manddarran Posted April 15, 2010 Author Posted April 15, 2010 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... Quote
alanjt Posted April 15, 2010 Posted April 15, 2010 You knew what I meant 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. Quote
Lee Mac Posted April 15, 2010 Posted April 15, 2010 Just sounded like you were being picky is all Quote
alanjt Posted April 15, 2010 Posted April 15, 2010 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. Quote
manddarran Posted May 12, 2010 Author Posted May 12, 2010 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 Quote
manddarran Posted May 20, 2010 Author Posted May 20, 2010 I have finally fixed it. Attached is the working copy as well as the block that it uses. hs.lsp farea.dwg Quote
manddarran Posted May 27, 2010 Author Posted May 27, 2010 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. Quote
Recommended Posts
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.