Sam Jones Posted September 21, 2020 Share Posted September 21, 2020 1. Can I create a viewport with using DoMenuTextByName which calls up the set up dialog. 2. If a viewport already exists, can I set its scale with VS 3. Can I set any viewport criteria besides overrides with VS As always, TIA Quote Link to comment
Pat Stanford Posted September 21, 2020 Share Posted September 21, 2020 1. Yes 2. Yes. Using SetObjectVariable 3. Yes. Almost everything using ObjectVariables. Quote Link to comment
JBenghiat Posted September 21, 2020 Share Posted September 21, 2020 The hardest thing with DoMenuText is probably getting the handle to the new viewport. You have the most control with custom dialogs and the CreateVP command. Viewport object variables below // Viewport type selectors // -------------- const short ovViewportProjectionType = 1000; // short read/write - the viewport projection type. - Public for VS const short ovViewportRenderType = 1001; // short read/write - the viewport render type. - Public for VS const short ovViewportPerspectiveDistance = 1002; // real read/write - the viewport perspective distance (used with custom perspective). - Public for VS const short ovViewportScale = 1003; // real read/write - the viewport scale. - Public for VS const short ovViewportDirty = 1004; // Boolean read/write - the viewport out-of-date (dirty) state. - Public for VS const short ovViewportProject2D = 1005; // Boolean read/write - the viewport project 2D state. - Public for VS const short ovViewportRenderBackground = 1006; // Sint32 read/write - the viewport render background. - Public for VS const short ovViewportViewType = 1007; // short read/write - the viewport view type. - Public for VS const short ovViewportLineWeightScale = 1008; // double read/write - the viewport line weight scale. - Public for VS const short ovViewportArrowheadScale = 1009; // double read/write - the viewport arrowhead scale. - Public for VS const short ovViewportDashedLineScale = 1010; // double read/write - the viewport dashed line length/spacing scale. - Public for VS const short ovViewportHatchLineScale = 1011; // double read/write - the viewport hatch line spacing scale. - Public for VS const short ovViewportDesignTextScale = 1012; // double read/write - the viewport design layer referenced text size scale. - Public for VS const short ovViewportSlashThicknessScale = 1013; // double read/write - the viewport slash thcikness scale. - Public for VS const short ovViewportAmbientIsOn = 1014; // Boolean read/write - the viewport ambient light is ON or OFF. - Public for VS const short ovViewportAmbientBrightness = 1015; // double read/write - the viewport ambient light brightness. - Public for VS const short ovViewportAmbientColor = 1016; // WorldPt3 read/write - the viewport ambient light color. - Public for VS const short ovSetDesignLayerVisibilityInAllViewports = 1017; // short, -1 = invisible, 0 = normal, 2 = grayed - Public for VS const short ovSetClassVisibilityInAllViewports = 1018; // short, -1 = invisible, 0 = normal, 2 = grayed - Public for VS const short ovViewportHDRIBackground = 1019; // Sint32 read only - the background for environment lighting - Public for VS const short ovSectionVP2DAttributeClass = 1020; // Sint32 read only - the RefNumber of the class responsible for attributes of overall cross-section or just the x-section of structural elements. - Public for VS const short ovSectionVP2DOtherAttribClass = 1021; // Sint32 read only - the RefNumber of the class responsible for attributes of cross-section generated from non-structural elements - Public for VS const short ovSectionVP3DFillStyleClass = 1022; // Sint32 read only - the RefNumber of the class reposnsible for fill style of the objects beyond section plane - Public for VS const short ovSectionVP3DLineStyleClass = 1023; // Sint32 read only - the RefNumber of the class responsible for line style of the objects beyond section plane - Public for VS const short ovViewportXPosition = 1024; // double read only - the X coordinate of the viewport on the sheet layer - Public for VS const short ovViewportYPosition = 1025; // double read only - the Y coordinate of the viewport on the sheet layer - Public for VS const short ovViewportAngleWithXAxis = 1026; // double read only - the angle that the viewport subtends with the X axis on the sheet layer in degrees - Public for VS const short ovViewportShowWallComponents_OBSOLETE = 1027; const short ovViewportGrayTransparent = 1028; // Boolean read/write - the viewport renders gray layers transparent - Public for VS const short ovViewportFlipText = 1029; // Boolean read/write - the viewport/dlvp adjusts for flipped text - Public for VS const short ovViewportBlackAndWhite = 1030; // Boolean read/write - the viewport/dlvp draws in black and white only - Public for VS const short ovViewportUseDocumentClassVis = 1031; // Boolean read/write - set/reads the Use Document Class visibilities settings for dlvps - Public for VS const short ovViewportDescription = 1032; // TXString read/write - a description for the viewport, which corresponds to the Dwg Title field for a corresponding Drawing Label. - Public for VS const short ovViewportLocator = 1033; // TXString read/write - the locator for the viewport, which corresponds to the Item field for a corresponding Drawing Label. - Public for VS const short ovViewportIsLinked = 1034; // Boolean read - indicates whether the viewport is a linked viewport const short ovViewportDisplayPlanar = 1035; // Boolean read/write - the flag to indicate if planar and 2D objects are to be displayed const short ovViewportForegroundRenderType = 1036; // short read/write - the viewport render type. - Public for VS const short ovViewportHasCamera = 1037; // Boolean read only - whether there is a camera attached to the viewport or not const short ovCameraAttachedToViewport = 1038; // Boolean read only - whether the camera is attached to a viewport or not const short ovViewportCropVisible = 1039; // Boolean read/write - get/set the Crop Visible state of a viewport - Public for VS const short ovViewportLayerHeightIgnored = 1040; // Boolean read only - whether the viewport ignored layer height for single layer case const short ovViewportLightingDevice = 1041; // read/write - make an association between a lighting device light and an overriden light object for the viewport. const short ovViewportRePositionDimensionText = 1042; // Boolean read/write - the viewport/dlvp re-positions dimension text to other side of dimension line - Public for VS const short ovIsDesignLayerSectionViewport = 1043; // Boolean read only - indicates whether the linked viewport is a sheet layer or a design layer viewport - Public fo VS const short ovFDLSVPHiddenLineInWireframe_OBSOLETE = 1044; const short ovViewportPageSymbolScale = 1045; // double read/write - the viewport page symbol scale. - Public for VS const short ovViewportNavigateToFromSectMarker = 1046; // Boolean write only - selects the viewport and makes it visible - Not for public use const short ovViewportDetailLevel = 1047; // short read/write - low detail = 0, medium detail = 1, high detail = 2 - Public for VS const short ovViewportIsHorizontalSection = 1048; // Boolean read - indicates whether the viewport is horizontal section const short ovViewportTransformMatrix = 1049; // TransformMatrix read/write const short ovViewportViewMatrix = 1050; // TransformMatrix read/write const short ovViewportOperatingTransform = 1051; // TransformMatrix read const short ovViewportUnscaledBoundsWithoutAnnotations = 1052; // WorldRect read const short ovViewportResetForOnlyAnnotationsChange = 1053; // void write const short ovIsSectionViewport = 1054; // Boolean read only - indicates whether the viewport is a section viewport - Public for VS const short ovSheetLayerSectionViewportViewMatrix = 1055; // TransformMatrix read const short ovSectionViewportSectionViewMatrix = 1056; // TransformMatrix read Quote Link to comment
Sam Jones Posted September 21, 2020 Author Share Posted September 21, 2020 OK, just a little bit of whining here. "CreateVP" is in the "Objects-Groups" division of the VS reference and not in the "Viewports" division. WTF. Quote Link to comment
Sam Jones Posted September 21, 2020 Author Share Posted September 21, 2020 How do I specify what is in the Viewport when I run the "CreateVP" command. I want to create a bunch of objects on a design layer, the created objects are the only things on the design layer. I then want to create a design layer viewport and assign it to a sheet layer. So how does that work? Quote Link to comment
JBenghiat Posted September 21, 2020 Share Posted September 21, 2020 You pass the handle of the sheet layer to the CreateVP command. Then iterate through the layers in the drawing, and use SetVPLayerVisibility() to set the layers to invisible, except for your desired layer. I also imagine that the command works similarly to the menu in that the current view options is the basis for the viewport. Quote Link to comment
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.