Jump to content

Search the Community

Showing results for tags 'viewport'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions


  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...

  1. Hello to everybody, I'm writing my first message as I started developing my first App. The thing is I have a dwg with the same number of paper space layouts and views, and the same viewport for all the paper space's layouts. So the problem is: I'm stuck trying to link the viewport of each layout to the correspondig view. I attach in .txt the code for VB.NET and appreciate if anybody can help me in this very first real project. Thanks for helping.CODES.txt
  2. sinergy

    Viewport issue

    Hi, I am actually using Autocad Architecture 2021 on Windows 10, intel i7. I created a layout/sheet to present the images in the model, the first viewport that I created there works fine. I then created a second viewport just on top of the previous one (as in the attached image) The problem with this second viewport is that when I double-click on it (as in the second image) I enter the model space. There I can see a miniature of the image I am working on there but as soon as I zoom in in order to focus on the part of the drawing that I want to represent in this viewport, the image instead of becoming enlarged, desappears for sight, no matter how small the increment in size (through the zooming is), and don't have a clue on why this may be happening. Could it be because I am overlapping two viewports?
  3. Hey guys, So I have a block reference in ModelSpace, and a Viewport located on a Layout with 5-6 other viewports. I was trying to write a subfunction that would zoom that certain viewport to the bounding box's of that block reference. I've never dealt with VIEWPORTS, So I currently assembled this sub, from @rlx's code which works as I've expected: ; Currently using this : ; (ViewportZoomToBlockReference "header" (vlax-ename->vla-object (car (entsel)))) (defun ViewportZoomToBlockReference ( BlockRefName VportObj / BlockRefName oldcmdecho vplist curcvport nr vpss ms en x SS blk ll ur ) (cond ( (not (tblsearch "BLOCK" BlockRefName)) (princ (strcat "\nUnable to find " BlockRefName " block definition")) ) ( (not ( (lambda ( / ctab ) (setq ctab (getvar 'ctab)) (setvar 'ctab "Model") (setq SS (ssget "_X" (list (cons 0 "INSERT") (cons 2 BlockRefName) (if (= 1 (getvar 'cvport)) (cons 410 (getvar 'ctab)) '(410 . "Model"))))) (setvar 'ctab ctab) SS ); lambda ) ) (princ (strcat "\nUnable to obtain selection for " BlockRefName " blocks")) ) ( (not (setq blk (vlax-ename->vla-object (ssname SS 0)))) ) (t (setq oldcmdecho (getvar "cmdecho"))(setvar "cmdecho" 0)(setq vplist (mapcar 'car (vports)))(setq curcvport (getvar "cvport")) (if (= (getvar "tilemode") 0) (progn (if (= (setq ms (getvar "cvport")) 1)(command "._mspace")) (setq nr 0 vpss (ssget "_x" (list '(-4 . "<AND") '(0 . "VIEWPORT")(cons 410 (getvar "ctab")) '(-4 . "<NOT") '(69 . 1) '(-4 . "NOT>") '(-4 . "AND>")))) (setq en (entget (vlax-vla-object->ename VportObj))) (if (and (= 0 (logand 1 (cdr (assoc 90 en))))(< 0 (cdr (assoc 68 en)))(/= 16384 (logand 16384 (cdr (assoc 90 en))))) (progn (setvar "cvport" (cdr (assoc 69 en))) (vla-GetBoundingBox blk 'll 'ur) (vla-ZoomWindow (vlax-get-acad-object) ll ur) ) ) (if (= ms 1) (command "._pspace")) ) ; (foreach x vplist (setvar "cvport" x) (command "._zoom" "_e")) ) (setq vpss nil)(setvar "cvport" curcvport)(setvar "cmdecho" oldcmdecho) ); t ); cond ); ViewportZoomToBlockReference Problem is that it uses command calls, and I need to use this sub for 3-4 different viewports (for 'header', 'footer', 'side-legend', 'main-window') on like 100 layouts and the whole thing becomes very sloow... So right now I'm trying to figure out how to 'activate' that certain viewport, zoom to the BoundingBox, and 'deactivate' it, with ActiveX. BTW I've checked out this regarding viewport activation/deactivation, but unfortunately doesn't work for me (upon 'manual' testing).
  4. Currently the view port color over write doesn't effect the colors of nested blocks. The nested blocks show the global color of the layer. Ideally VP color over write should behave same as changing global color of layer. Is there a way to achieve it (beside exploding the blocks to remove nesting). For example see attached sample file. I want all elements in the blocks to have the overwritten color in the view port i.e. color 20, instead it is showing the nested blocks as yellow which is not what i want. sample.dwg
  5. See screenshot of what my routine does. It creates new vports from closed LWpolylines and locks them. I just don't know how to do the same as this below. GIF of Routine: CODE: ;; ----------------------=={ VP_Clip_All_LWPS }==------------------------- ;; ----------------------------------------------------------------------- ;; AUTHOR & ADDITIONAL CODE ;; Author: 3dwannab, Copyright © 2018. ;; Error functions: LeeMac Help pages. www.lee-mac.com. ;; ABOUT / NOTES ;; Creates new VIEWPORT/s from existing closed LWPOLYLINE/s. ;; FUNCTION SYNTAX ;; Short-cut VP_CALLS ;; Long-cut VP_Clip_All_LWPS ;; VERSION DATE INFO ;; Version 1.0 27-07-2018 Initial release. ;; TO DO LIST ;; Increase the overall scale of the VIEWPORT from 1:20 to 1:2 for example. ;; ----------------------------------------------------------------------- ;; ------------------=={ VP_Clip_All_LWPS START }==----------------------- (defun c:---VP_Clip_All_LWPS (/) (progn (LOAD "VP_Clip_All_LWPS") (C:VP_Clip_All_LWPS))) (defun c:VP_CALLS () (c:VP_Clip_All_LWPS)) (defun c:VP_Clip_All_LWPS (/ ent_vp i ss_1 var_cmde var_os y ) (setq *error* LM:error) (LM:startundo) (setq var_cmde (getvar "cmdecho")) (setq var_os (getvar "osmode")) (setvar 'cmdecho 0) (setvar 'osmode 0) (cond ((> (getvar 'CVPORT) 1) (princ "\n ** Command not allowed in Model Tab ** ")) ( (while (not (and (setq ent_vp (car (entsel "\nPlease select 1 VIEWPORT,\nthen any closed LWPOLYLINES within to create\nnew VPs from\n: --------------------------------------------------------- :\n")) ent_vp_data (if ent_vp (entget ent_vp)) ) (= (cdr (assoc 0 ent_vp_data)) "VIEWPORT") (progn (if (setq ss_1 (ssget '((0 . "LWPOLYLINE") (-4 . "=") (70 . 1)))) (progn (command "_.vports" "_lock" "_on" ent_vp "") (command "_.copybase" '(0 0) ent_vp "") (entdel ent_vp) (repeat (setq i (sslength ss_1)) (command "_.pasteclip" "_non" '(0 0)) (setq ent_last (entlast)) (command "_.vpclip" ent_last (ssname ss_1 (setq i (1- i)))) ) (repeat (setq y (sslength ss_1)) (command "_.vpclip" (ssname ss_1 (setq y (1- y))) "_D") ) ) (progn (princ "\n*** Nothing Selected ***\n")(princ) ) ) ) ) ) (princ (strcat "\n >>> " (itoa (setq ss_1_len (sslength ss_1))) (if (> ss_1_len 1) " new viewports have been created" " new viewport has been created") " <<< \n")) ) ) ) (*error* nil)(princ) (princ) ) ;; ----------------------------------------------------------------------- ;; ---------------------=={ Functions START }==--------------------------- (vl-load-com) (defun LM:error (errmsg) (and acDoc (vla-EndUndoMark acDoc)) (and errmsg (not (wcmatch (strcase errmsg) "*CANCEL*,*EXIT*")) (princ (strcat "\n<< Error: " errmsg " >>\n")) ) (setvar 'cmdecho var_cmde) (setvar 'osmode var_os) ) (princ) (defun LM:startundo () (setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (or (vla-EndUndoMark acDoc) (vla-StartUndoMark acDoc)) ) (princ) ;; ----------------------------------------------------------------------- ;; -----------------------=={ Functions END }==-- ------------------------ (princ "\nVP_Clip_All_LWPS.lsp loaded | Version 1.0 | by 3dwannab.\n") (princ "\nType \"VP_Clip_All_LWPS\" OR \"VP_CALLS\" to run.\n") (princ) ;; ----------------------------------------------------------------------- ;; --------------------=={ VP_Clip_All_LWPS END }==----------------------- ;; EOL
  6. Hi, I try to plot my drawings in this new template that i created - with all those new layer. I have compared it with my other drawings, the layer properties is pretty much the same however for this drawing, some of my layer are not visible in the viewport and missing when i plot the view. All layer missing are in white colors. Do you guys happened to know why this is happening and what are the solution? Thanks.
  7. Dell Optiplex 3020 AutoCAD 2019 updated (P.61.0.0 AutoCAD 2019.0.1) Logitech M500 corded mouse I am in paperspace, zooming in and out, copying item tag blocks over a locked viewport. The view in the viewport will suddenly act as if I am IN an unlocked viewport and zooms out/pans. Hitting undo a few times gets it back to the right view. It only happens occasionally and only since I upgraded to 2019. As 2018 got buggy and kept crashing, I can't go back to it. Saved/exited/reopened the drawing...still does it. Purge...still does it. Audit...still does it. Dxfout & open dxf...still does it. I notice that whenever it happens, the viewport goes from Annotation scale: 3/32 = 1'-0", Standard scale: 3/32 = 1'-0", Custom scale: 0" to Annotation scale: 3/32 = 1'-0", Standard scale: Custom, Custom scale: 0" Attached is the drawing saves as 2013 viewport problem.dwg
  8. Hi everyone, I'm new to using macros/lisps in AutoCAD, though I do have a small programming background in some other programs. To give you some background on what I'm trying to do: I have a big .dwg file that shows all of the roads in a particular city in the USA, and I have created views of all of the intersections that have crosswalks. All of these intersections have their own intersection IDs, which have a format such as BRI1, BRI2A, BRI3B, BRI4, BRI5, etc. I have already created all of the views from these intersections (of which there are over 100), and now, in the same .dwg, I am trying to quickly create layouts from a template that show only one view each. I have a .dwt set up for this, and the name of the layout for this template is EB124. I am having no trouble creating these layouts individually, but as there are over 100 in this particular section of the city, I want to be able to quickly create the layouts and then move onto the next section. Here are the commands that I used to try to create a macro for this using the Action Recorder: -layout > t > [select template from file] > EB124 -layout > set > EB124 -layout > rename > EB124 > [ASK FOR USER INPUT] [select the viewport in the new layout and unlock the display] MSPACE -view > restore > [ASK FOR USER INPUT] PSPACE [select the viewport and lock the display] When I do these all while recording the macro, it works perfectly. However, when I try to play the resulting macro, it works like a charm until it seems like the macro doesn't actually execute the MSPACE command? So I am in paperspace when it executes the -view>restore portion, which then seems to delete the xref that contains the titleblock? I have tried using REA afterward in case the xref is just not showing up, but it looks like it is instead replaced by a polyline, which seems bizarre to me. I also tried executing the -view>restore command while in paperspace outside of the macro to try to replicate the problem, and it results in the same problem. I have attached screenshots of the action recorder commands (because I don't think I can attach the .actm file?) as well as screenshots of what correct results and actual results look like. Note that the views in the "correct" vs "incorrect" results are different, and this is OK. Unfortunately due to confidentiality, I cannot actually attach the .dwg file. I also figure that there is an easier way to do this using lisps, but I just don't even know where to start... Thanks in advance for any help!
  9. For example lisp is drawing complicated shapes out of individual lines – is there a way to “pause” the display for the duration of the function, so that complete linework just show all at once, instead of each individual line with flickering screen? Many Thanks
  10. My drawings have multiple layouts with multiple View Ports in each, the drawing has a few Layer States set up (mainly made up of VP freezes). Within each layout all different layer states are used in various view ports. Problem is when I have to update a layer state they don't automatically update all the view port using the same layer state. I have to individually click into each view port and restore the state via the layer manager the (there are hundreds of view ports). Is there a variable I have to set (my VISRETAIN is set to 1 and would like to keep at 1)? How can I make the layer state apply changes to all view ports (if not the whole drawing then layout by layout would help) using the same layer state when updated?
  11. Hello, guys! So, I have this 3D view of my project and my personal layout on the same .dwg file. Attached herewith is a screenshot of the 3D view, that I want to place on my layout, and my own personal layout. Can somebody please give me a step-by-step procedure on how to this. An example is also attached for your reference. Thank you very much & I appreciate whatever help you can give me
  12. asperotti415

    Viewport Help

    Hi, I can't seem to pan or zoom, and the viewport is NOT locked. Please help. I keep having to delete the viewports and start over. Easy fix but time consuming when I have to recreate a dozen layouts. Thank you!
  13. I've had this issue before but never really investigated it further until today. I use a lot of polygonal viewports to show twisting routes of water mains along a section of an OS map and add connection details in the remaining paper space areas. What I've noticed when using this method is that OSNAPS still snap to the map features in the empty space, however, only within a rectangular area that would fit the extents of the polygonal viewport. I'm not looking for a fix as it's not a major issue, but just thought I'd report it and see if anyone else has noticed it and knows why it happens?
  14. So, this is a weird problem. I can't get the vertices of the polyline that makes up a non-rectangular viewport. To replicate my problem, start with a rectangular viewport, rotate it in the paper space and move one of it's vertices. Now for some reason property number 340 is not the polyline that makes up the viewport. I was originally using lee-mac's 'vpoutline' lisp script (can't add link since I'm a newbie) to draw an outline of the viewport but that doesn't even work (if lee-mac's script can't work it out then something is very wrong!!) As you can see on the left is the viewport. Prop 340 should be the pline. Go into the pline and it has no vertices (middle)! On the right and bottom are me finding the correct pline a different way (not programmatically) and the vertices are all there and indeed correct. To be very clear, if you draw a polygonal viewport from scratch everything is fine, that's not my problem. This only applies to a rectangular viewport you have rotated and moved one of it's vertices. So how do I get the vertices of the pline that makes up the viewport?
  15. I have a couple of viewports where I just want to show spot elevations of my surface and not the contours. Whenever I freeze the contours my spot elevations disappear too. When I select a spot elevation it's layer shows as "C-TOPO-TEXT" and when I right-click and go to "Edit Label Style" the label layer is "GRADE-P-T". When I select my contour lines they are on a "C-TOPO" layer, and then when I go to "Edit Surface Style", "Display" tab it shows that the major and minor contours are on "CONTMJR-P-L" and "CONTMNR-P-L" layers respectively. My point being that it seems like they are all on different layers, so I would think I could freeze/thaw the two interchangeably. What am I missing? Thanks ahead of time!
  16. Hello All, I have looked around a little bit and haven't been able to find the answer I am looking for. I know commands like LAYTHW AND LAYON. I also used the info from "Michael's Corner" latest post. Everything is turned on and everything is thawed. However, it does not thaw layers that are labeled as VP Freeze. Instead of going to the layer properties manager, select all, and thawing the layers that are frozen in the view port freeze, is there a way to thaw all of them with a simple command or a button that is already created or one that I can make in the CUI? As always, any and all comments are appreciated. I have a feeling ReMark, BlackBox, BIGAL may have some insight in to this, or at least point me in the right direction.
  17. Is it possible to use a DB with viewports? The attached file contains the DB with notes indicating what I would like to do with the DB. Basically I made a stretchable box that would be used on our detail sheets. This box has text that will stay at its location in relation to the DB. I've noticed that I can not use constraints on the DB after its inserted into the drawing. Is this normal? For example, I want to add a viewport to the DB and constrain its size using parametric dims but when I do this the DB is no longer a DB. Hopefully the attached file can better explain what I need. Perhaps I'm asking too much. THANKS! VIEWPORT.dwg
  18. Dschechter

    annotative dimensions

    Trying to practice annotative scaling in viewports, but dimensions in the lower right viewport are larger text than they should be. Is something compounded to make it larger? All are using same annotative dimension style. I feel like it's something obvious thank you! [ATTACH]54698[/ATTACH] 2010 v. annotative practice.dwg annotative practice 2010.dwg
  19. can someone PLEASE help me make this using viewports?? its for my final tomorrow. i have to use three right viewport and it has to have those dimensions
  20. This is probably too extensive a question for this forum - if there is a tutorial that covers this, please point me in the right direction. Background: I work for a large utility company, which for some reason doesn't think AutoCAD training is important for its entry level engineers (who use CAD daily), so it's incumbent upon me to figure it out. Thanks *** Gas & Electric! I'm working off a .dwg file I inherited from the one dude who seemed to know what he was doing. He's moved on, or I'd be harassing him for help instead of coming here. He's got it set up so that (pardon my terminology ignorance) the blue rectangle in model space is assigned to the drawing area of one of the templates (paper space). There are two pink rectangles assigned to additional templates (on their own tabs). They are "fixed", so that the scale cannot be modified while in paper space. I would like to add a new template (new tab) to this .dwg file, assigned to its own blue (or pink? Does color mean something?) rectangle in model space, set up this same way (no scaling in paper space). How can I go about it? If you can help, please pretend that I've suffered a recent head injury and am having difficulty understanding. I really don't know WTF I'm doing.
  21. Hi Guys I have a dwg. with lot of Layers. I want to view only a couple of layers in the viewport. The method I use is - LAYFRZ/VPLAYER all the OTHER layers. So just wondering if there is a command through which I select couple of required layers and freeze all other layers, except those selected layers, at one go in viewport. or - there is an quicker alternate method/ procedure for doing it. NOTE: I cant use LAYISO coz it freezes all the other layers in MODEL space as well. Thanks
  22. goaliegrrl

    ALIGNSPACE Weirdness

    I have no actual AutoCAD training, so please forgive any made up terms on my part. I am attempting to align my paperspace with the viewport in model space. My understanding of viewports is quite limited. I select the alignment points in MODEL SPACE (upper right corner, lower left corner), the same points in PAPER SPACE, hit enter, and this happens: The origin skews several degrees. What gives? This very well may be entirely the wrong way of going about this... Any help is very much appreciated.
  23. I'm working on a drawing in AutoCAD 2007 , where final document will have several viewports - one of them should have no Line weight values. Any ideas guys ?
  24. I have a layer that seems to displaying incorrectly. I am trying to freeze "NoPlot" through a viewport. It is also freezing out on paperspace. Am I wrong in thinking it should only freeze "inside" the viewport? Test.dwg
  25. Used to use servCAD that had a tool that rotated text to "E" no matter how the viewport was rotated. Say the viewport is rotated where W is straight up. The text would need to have a rotation of "N" for it to be horizontal across the page in model space. Now that I have Civil 3D 2015 I do not see any tool pac or command that I can use to be efficient in this. The problem is time. Time is money. If a viewport was originally with North straight up and text had a rotation of "E" and I changed the viewport to West straight up, is there a quick way to change the properties of all the text? Besides match properties. It takes too long to individually select each text and rotate all of them. Even if I select all the text and change the rotation in the properties I have to go back and move all the text so it lines up with leaders and whatnot. I feel like I may have rambled on a little too much but hope this all makes sense. I am the worlds worst describer of my thoughts. Any insight would be wonderful. Thanks, Miller
  • Create New...