autocad-plugin

Saving AutoCAD files (.dwg) using Python

假如想象 提交于 2021-02-15 06:28:12
问题 I am using win32com to automate some simple tasks in AutoCAD. It's mostly been working quite well except for being able to save files. My goal is to open a (template) file, adjust it depending on what is needed then save the file as a .dwg in another folder while leaving the template empty and ready to be used next time. The following in an example of my code: import win32com.client acad = win32com.client.dynamic.Dispatch("AutoCAD.Application") acad.Visible=True doc = acad.Documents.Open("C:\

AutoLisp trying to select LWPolyline BUT ONLY RECTANGLES. How do I do that?

时光怂恿深爱的人放手 提交于 2021-01-29 15:50:25
问题 So I'm trying to select all entities that are rectangles. I tried this (setq ss (ssget "X" '((0 . "RECTANG")))) , but it seems to select all polylines, including polygons. I tried with checking the vertices = 4 but then it also selects diamonds. How could I implement such a code? 回答1: I'd be highly surprised if your current code using the ssget filter list '((0 . "RECTANG")) was to select anything at all, as RECTANG is not a valid entity type for DXF group 0. In AutoCAD, the standard RECTANG

C# Revit API - How to pull info from autocad File

╄→尐↘猪︶ㄣ 提交于 2020-03-24 00:05:33
问题 I've been working on this for the past month and am trying to get the final connection. so far, I can open Revit, execute an Autocad DLL from a Revit button however I don't know how to pull the information back into the Revit API. I have tried a couple of different methods however I've come to a wall. Here are the options I've tried with explanations below 1) Combine the DLL file and the Revit Button API file into one using classes. ---> Trying this method leaves me with an error when loading

Polylines extended on canvas while overdrawing with use of PointCollection C# WPF

荒凉一梦 提交于 2020-03-06 07:32:06
问题 I am creating autocad plugin which get points from existing geometry, pass it to another windows and create object with same geometry on canvas as polyline. Autocad object is polyline so some points (vertices) must be overdrawn. I gather points from autocad, length of vertices and transform that to center object in real coordinates on canvas. Then when I draw it, i get this: The points that i collect are correct, they are transformed simetrically. And the code for drawing on canvas is here:

Polylines extended on canvas while overdrawing with use of PointCollection C# WPF

我怕爱的太早我们不能终老 提交于 2020-03-06 07:31:21
问题 I am creating autocad plugin which get points from existing geometry, pass it to another windows and create object with same geometry on canvas as polyline. Autocad object is polyline so some points (vertices) must be overdrawn. I gather points from autocad, length of vertices and transform that to center object in real coordinates on canvas. Then when I draw it, i get this: The points that i collect are correct, they are transformed simetrically. And the code for drawing on canvas is here:

Targetting x64 platform with entity framework 4.1 in Visual Studio 2010

血红的双手。 提交于 2020-01-15 03:18:07
问题 I have a database application that references Entity Framework 4.1. In the properties window of the project both the Configuration as well as Platform selection options are disabled. I wan't to target this application only for x64 systems. Also there are some other projects in the same Solution and they have only x86 option avaliable as platform. I don't get the idea why I couldn't target x64 systems specifically. I have windows 7 64 bit running on my pc. Any clues how to target specifically

Add attribute to block: Autocad API VB.net

坚强是说给别人听的谎言 提交于 2020-01-03 04:32:11
问题 I am using below code to add attribute to certain block, But it does not work, I am not getting what exactly going wrong and there is no error. Public Class addattribute Public Function addnewattribute() Dim attdef As New AttributeReference Dim templatepath As String = "C:\Users\sesa388372\Documents\Visual Studio 2015\Projects\SchneiderMacros\Wtemplate.DWG" Dim db As Database = New Database db.ReadDwgFile(templatepath, System.IO.FileShare.ReadWrite, False, "") Using tr As Transaction = db

ReadDwgFile from URL in Autocad I/O

╄→尐↘猪︶ㄣ 提交于 2019-12-25 08:48:30
问题 I try to do a program upload in AUtocad I/O It works good in local but in the cloud i get the message : Error: Autodesk.AutoCAD.Runtime.Exception: eInetFileOpenFailed [10/03/2017 09:05:07] at Autodesk.AutoCAD.DatabaseServices.Database.ReadDwgFile(String fileName, FileShare fileSharing, Boolean allowCPConversion, String password) I use this code to get the DWG that i need to implement. blockQualifiedFileName = "http://urltoDWG.dwg"; sourceDb.ReadDwgFile(blockQualifiedFileName, System.IO

Autocad 2018 autoload dll

*爱你&永不变心* 提交于 2019-12-24 07:19:06
问题 I am trying to automatically load dll files to Autocad 2018. How can i achieve that? I want to automate so it can do it on startup. With netload everything works. I have used *.lsp ways. Can someone please help? I have found plenty online of ways but none work. 回答1: AutoCAD's official way to load .dll files written in .Net on startup is to use autoloader feature. You basically bundle the .dll with any other files you want into a default folder where AutoCAD reads at startup to load all plug

ObjectARX, RealDWG or Teigha? [closed]

淺唱寂寞╮ 提交于 2019-12-23 17:10:05
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . I'm planning on developing a piece of software that reads & manipulates data in a .dwg file. Instead of writing my own library that handles the 'reading' of the data file, I've decided to use either RealDWG or Teigha, however I'm struggling to understand exactly how they work.