Well.... I had a message typed back to everyone but I must have closed my browser before posting it... (my bad)
Anyway...
This is working to draw the views but doesnt draw the view in the correct place... see the attached pictures
(works perfectly in NEW drawings....????? i just found out) Any clue as to what could cause that. I did double check if the boundaries were correct.
(DEFUN C:VBOUND (/ DATA MIDPT LEN WID X Y MINPT MAXPT VIEW)
(SETQ VIEW (GETSTRING "\nENTER VIEW OR PRESS ENTER...")
VIEWS (ai_table "view" 0))
(COND
((EQ "" VIEW )
(setq view nil)
))
(IF
(eq VIEW NIL)
(PROGN
(FOREACH V VIEWS
(IF (SETQ DATA (TBLSEARCH "VIEW" V))
(PROGN
(setq
MIDPT (CDR (ASSOC 10 DATA))
WID (/ (CDR (ASSOC 40 DATA)) 2)
LEN (/ (CDR (ASSOC 41 DATA)) 2)
X (CAR MIDPT)
Y (CADR MIDPT)
MINPT (LIST (- X LEN) (- Y WID))
MAXPT (LIST (+ X LEN) (+ Y WID))
)
(COMMAND "RECTANGLE" MINPT MAXPT)
);_progn
);_if
)
)
)
(IF (SETQ DATA (TBLSEARCH "VIEW" View))
(PROGN
(setq
MIDPT (CDR (ASSOC 10 DATA))
WID (/ (CDR (ASSOC 40 DATA)) 2)
LEN (/ (CDR (ASSOC 41 DATA)) 2)
X (CAR MIDPT)
Y (CADR MIDPT)
MINPT (LIST (- X LEN) (- Y WID))
MAXPT (LIST (+ X LEN) (+ Y WID))
)
(COMMAND "RECTANGLE" MINPT MAXPT)
);_progn
)
)
@Kent1Cooper there is some missing parentheses in your attached code which i added and came up with this.(btw thanks for that, AND thanks for the replies to everyone else!)
(DEFUN C:VBOUND (/ DATA MIDPT LEN WID X Y MINPT MAXPT VIEW)
(SETQ VIEW (GETSTRING "\nENTER VIEW OR PRESS ENTER...")
VIEWS (ai_table "view" 0))
(COND
((EQ "" VIEW)
(setq view nil)
))
(IF
(= VIEW NIL)
(PROGN
(FOREACH V VIEWS
(IF
(SETQ
DATA (TBLSEARCH "VIEW" VIEW)
MIDPT (CDR (ASSOC 10 DATA))
halfrect (list (/ (CDR (ASSOC 41 DATA)) 2) (/ (CDR (ASSOC 40 DATA)) 2))
); setq
(COMMAND "_.rectang" "_non" (mapcar '- midpt halfrect) "_non" (mapcar '+ midpt halfrect))
); if
); foreach
)
)
(IF
(SETQ
DATA (TBLSEARCH "VIEW" VIEW)
MIDPT (CDR (ASSOC 10 DATA))
halfrect (list (/ (CDR (ASSOC 41 DATA)) 2) (/ (CDR (ASSOC 40 DATA)) 2))
); setq
(COMMAND "_.rectang" "_non" (mapcar '- midpt halfrect) "_non" (mapcar '+ midpt halfrect))
)
)
However, I didnt have luck with this one.
It it kept saying something about command-s which I havent had a chance to dig into.
in the "missed placed views -1.png" the top leftish is where it was placing the supposed views which you can see in "missed placed views -2&3.png" thats not where the view was.
Sorry this is a tad lengthy.
thanks guys
have a great weekend!
Cheers