objectarxautocad2018vs2017qt59's Introduction
*use qmake convert pro to visual studio project *just use ascii on paths *open vs2017 x64 cmd cd /D C:/autocad_tools set PATH=C:/Qt/Qt5.9.2/5.9.2/msvc2017_64/bin;%PATH% qmake -r -tp vc "D:/test1/HellowWord/objectarx.pro"
objectarxautocad2018vs2017qt59's People
Forkers
secondmover softempire chechunlong danel996 1907931256 maze516 yyxuxyy yang123vc presscad ezhangle kitessa 15831944 124327288 renshuyuan wangafei ywenyoung198902 gtdongleobjectarxautocad2018vs2017qt59's Issues
ObjectARX .net
I would like to create a layout with 6 views in it(Top, Front, Left, Right, Bottom , Back ). The views should fit in the viewports accurately and the visual style be hidden. The views should be black in color so that i can view them when exported. Finally export the pdf.
ObjectARX code:
private static void StyleViewport(Autodesk.AutoCAD.DatabaseServices.Viewport viewport)
{
using (Database db = HostApplicationServices.WorkingDatabase)
{
using (Transaction tr = db.TransactionManager.StartTransaction())
{
// "Hidden" is the name of the visual style you want
viewport.VisualStyleId = GetVisualStyleId(db, "Hidden");
// Set other properties if needed
viewport.Color = Autodesk.AutoCAD.Colors.Color.FromRgb(0, 0, 0);
tr.Commit();
}
}
}
[CommandMethod("InsertViewsToLayout")]
public static void InsertViewsToLayout()
{
Document acDoc = Application.DocumentManager.MdiActiveDocument;
Database acCurDb = acDoc.Database;
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
BlockTable acBlkTbl;
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) as BlockTable;
BlockTableRecord acBlkTblRec;
acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.PaperSpace], OpenMode.ForWrite) as BlockTableRecord;
// Switch to the previous Paper space layout
Application.SetSystemVariable("TILEMODE", 0);
acDoc.Editor.SwitchToPaperSpace();
// Get the current layout
LayoutManager acLayoutMgr = LayoutManager.Current;
Layout acLayout = acTrans.GetObject(acLayoutMgr.GetLayoutId(acLayoutMgr.CurrentLayout), OpenMode.ForWrite) as Layout;
Point3d[] viewPositions = {
new Point3d(2.5, 5.5, 0),
new Point3d(2.5, 2.5, 0),
new Point3d(5.5, 5.5, 0),
new Point3d(5.5, 2.5, 0),
new Point3d(8.5, 5.5, 0),
new Point3d(8.5, 2.5, 0)
};
Vector3d[] viewDirections = {
new Vector3d(0, 0, -1),
new Vector3d(0, 0, 1),
new Vector3d(-1, 0, 0),
new Vector3d(1, 0, 0),
new Vector3d(0, -1, 0),
new Vector3d(0, 1, 0)
};
for (int i = 0; i < viewPositions.Length; i++)
{
using (Autodesk.AutoCAD.DatabaseServices.Viewport acVport = new Autodesk.AutoCAD.DatabaseServices.Viewport())
{
acVport.CenterPoint = viewPositions[i];
acVport.Width = 2.5;
acVport.Height = 2.5;
// Add the new viewport to the layout's block table record
acBlkTblRec.AppendEntity(acVport);
acTrans.AddNewlyCreatedDBObject(acVport, true);
// Set the view direction
acVport.ViewDirection = viewDirections[i];
// Set the visual style
StyleViewport(acVport);
// Enable the viewport
acVport.On = true;
}
}
acTrans.Commit();
acDoc.Editor.Regen();
}
}
Here's my code:
Error is :
Severity Code Description Project File Line Suppression State
Error CS0103 The name 'GetVisualStyleId' does not exist in the current context AutoCad C:\Users\source\repos\AutoCad\AutoCad\Commands.cs 268 Active
i am trying a lot but unable to figure out the solution.
Please resolve my issue.
You can also modify approach of viewports, You can insert views using "Base->Model Space" that way...
How to
请问该怎么样来建立项目呢?在objecratx 里面用qt的东西还是在qt libaray 项目用objectarx的东西?对应的是怎么来实现?我不太熟悉,麻烦说明一下?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.