Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 6
Anonymous
145 Views, 5 Replies

Veiw List?

Is there a String of code to get all the Paper Space Views in a Drawing? Or better yet only return views that start with a certain value. ("FR-") It seems like there should be one like (LayoutList) to accomplish this? Thanks for any help!!! Mark
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

Here's a little routine to return a list of views containing the view name and whether it's either a paper or a model space view. Example: (viewlist) (("signing" . "PAPER") ("profile" . "MODEL") ("plan" . "MODEL")) HTH, Jeff (defun viewlist (/ views v p vlist) (setq views (vla-get-views (vla-get-activedocument (vlax-get-acad-object)))) (vlax-for view views (setq v (entget (vlax-vla-object->ename view))) (if (and (assoc 70 v) (= (logand (cdr (assoc 70 v)) 1) 1) ) (setq p "PAPER") (setq p "MODEL") ) (setq vlist (cons (cons (vla-get-name view) p) vlist)) ) vlist ) "Mark Douglas" wrote in message news:405b3df5$1_2@newsprd01... > Is there a String of code to get all the Paper Space Views in a Drawing? Or > better yet only return views that start with a certain value. ("FR-") It > seems like there should be one like (LayoutList) to accomplish this? > > Thanks for any help!!! > > Mark > >
Message 3 of 6
Anonymous
in reply to: Anonymous

Thanks Im still stuck on trying to get a list of only Views that start with "FR-" Mark "Jeff Mishler" wrote in message news:405b4690_2@newsprd01... > Here's a little routine to return a list of views containing the view name > and whether it's either a paper or a model space view. > > Example: > (viewlist) > (("signing" . "PAPER") ("profile" . "MODEL") ("plan" . "MODEL")) > > HTH, > Jeff > > (defun viewlist (/ views v p vlist) > (setq views (vla-get-views > (vla-get-activedocument > (vlax-get-acad-object)))) > (vlax-for view views > (setq v (entget (vlax-vla-object->ename view))) > (if (and > (assoc 70 v) > (= (logand (cdr (assoc 70 v)) 1) 1) > ) > (setq p "PAPER") > (setq p "MODEL") > ) > (setq vlist (cons (cons (vla-get-name view) p) vlist)) > ) > vlist > ) > > "Mark Douglas" wrote in message > news:405b3df5$1_2@newsprd01... > > Is there a String of code to get all the Paper Space Views in a Drawing? > Or > > better yet only return views that start with a certain value. ("FR-") It > > seems like there should be one like (LayoutList) to accomplish this? > > > > Thanks for any help!!! > > > > Mark > > > > > >
Message 4 of 6
Anonymous
in reply to: Anonymous

; Jason Piercey . July 24th, 2003 ; performs a wildcard match between the second ; element in dxf code 2 and [entry] for each ; entry defined in [table]. ; [table] - string, table name ; [entry] - string, entry name ; return - list, list of entity lists ; example: (wcTblnext "dimstyle" "stan*") (defun wcTblnext (table entry / data rtn) (setq table (strcase table)) (setq entry (strcase entry)) (while (setq data (tblnext table (null data))) (if (wcmatch (strcase (cdr (assoc 2 data))) entry) (setq rtn (cons data rtn))) ) (reverse rtn) ) You would need to use it like this: (wcTblnext "view" "FR-*") Then do whatever you want with the list of data -- Autodesk Discussion Group Facilitator "Mark Douglas" wrote in message news:405b7342$1_1@newsprd01... > Thanks Im still stuck on trying to get a list of only Views that start with > "FR-" > > Mark
Message 5 of 6
Anonymous
in reply to: Anonymous

using vba... Dim objView As AcadView Dim objViews As AcadViews Dim strView As String Set objViews = ThisDrawing.Views For Each objView In objViews strView = objView.Name If strView Like "FR-" Then 'do whatever End If Next objView "Mark Douglas" wrote in message news:405b3df5$1_2@newsprd01... > Is there a String of code to get all the Paper Space Views in a Drawing? Or > better yet only return views that start with a certain value. ("FR-") It > seems like there should be one like (LayoutList) to accomplish this? > > Thanks for any help!!! > > Mark > >
Message 6 of 6
Anonymous
in reply to: Anonymous

(foreach x (viewlist) (if (wcmatch (car x) "FR-*") (setq fr-list (cons (car x) fr-list)) ) ) "Mark Douglas" wrote in message news:405b7342$1_1@newsprd01... > Thanks Im still stuck on trying to get a list of only Views that start with > "FR-" > > Mark > > > "Jeff Mishler" wrote in message > news:405b4690_2@newsprd01... > > Here's a little routine to return a list of views containing the view name > > and whether it's either a paper or a model space view. > > > > Example: > > (viewlist) > > (("signing" . "PAPER") ("profile" . "MODEL") ("plan" . "MODEL")) > > > > HTH, > > Jeff > > > > (defun viewlist (/ views v p vlist) > > (setq views (vla-get-views > > (vla-get-activedocument > > (vlax-get-acad-object)))) > > (vlax-for view views > > (setq v (entget (vlax-vla-object->ename view))) > > (if (and > > (assoc 70 v) > > (= (logand (cdr (assoc 70 v)) 1) 1) > > ) > > (setq p "PAPER") > > (setq p "MODEL") > > ) > > (setq vlist (cons (cons (vla-get-name view) p) vlist)) > > ) > > vlist > > ) > > > > "Mark Douglas" wrote in message > > news:405b3df5$1_2@newsprd01... > > > Is there a String of code to get all the Paper Space Views in a Drawing? > > Or > > > better yet only return views that start with a certain value. ("FR-") It > > > seems like there should be one like (LayoutList) to accomplish this? > > > > > > Thanks for any help!!! > > > > > > Mark > > > > > > > > > > > >

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost