乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: SEANT

[编程交流] .NET - Find COG of linear elem

[复制链接]

2

主题

12

帖子

10

银币

初来乍到

Rank: 1

铜币
10
发表于 2022-7-6 22:29:30 | 显示全部楼层
Interesting, im getting 2 different point locations for the polylines, but for the exploded lines i get the same location for the point
lcog.dwg
回复

使用道具 举报

10

主题

973

帖子

909

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 22:33:25 | 显示全部楼层
When I run it here I can only get the point on the right.  I’m not sure why the point on the left would appear unless some of the geometry is not being processed correctly.  Given the left shift, I assume some additional geometry is included left of center, or some geometry is being missed right of center.
 
I won’t have any more time tonight but will take another peak at the situation tomorrow morning.
回复

使用道具 举报

10

主题

973

帖子

909

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 22:34:31 | 显示全部楼层
Ah yes, there was a bug.  One of my steps was out of sequence and allowed processing geometry twice given a multiple crossing window selections.  
 
The first post has been updated with the corrected code.
回复

使用道具 举报

10

主题

973

帖子

909

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 22:38:51 | 显示全部楼层
The selection process was not very user friendly in the original; I modified it a bit for a more AutoCAD like feel.
 
Modified source code is available if necessary.
LCOG_rev3.zip
回复

使用道具 举报

RMS

9

主题

38

帖子

29

银币

初来乍到

Rank: 1

铜币
45
发表于 2022-7-6 22:41:05 | 显示全部楼层
 
OMG C# ....breath deep, its really just VB with some curly things {}.....and
and the comments are like C/C++
 
Nice Job Sean! I can see we have some Naval Architects / boat builders  here  and that is awesome!
回复

使用道具 举报

0

主题

3

帖子

3

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 22:45:38 | 显示全部楼层
I'm trying to load the dll file but something is going wrong. Can someone help me out?
 
This is what i get:
-----------------------------
 
Command: NETLOAD
Cannot load assembly. Error details: System.BadImageFormatException: Could not
load file or assembly 'file:///C:\Program Files\Autodesk\AutoCAD 2011\LCOG.dll'
or one of its dependencies. The module was expected to contain an assembly
manifest.
File name: 'file:///C:\Program Files\Autodesk\AutoCAD 2011\LCOG.dll'
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm,
Boolean forIntrospection, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
   at loadmgd()
 
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure
logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
 
Thanx in advance
回复

使用道具 举报

10

主题

973

帖子

909

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 22:48:38 | 显示全部楼层
Preliminary investigation suggests this to be a problem with 32bit/64bit compatibility.  What version of AutoCAD 2011 are you using?
回复

使用道具 举报

0

主题

3

帖子

3

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 22:50:25 | 显示全部楼层
thanks for your reply. I'm running AutoCAD 2011 on a 32bit machine.
回复

使用道具 举报

10

主题

973

帖子

909

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 22:55:44 | 显示全部楼层
Due to more specific targeting, this version may perform better.
LCOG.zip
回复

使用道具 举报

0

主题

3

帖子

3

银币

初来乍到

Rank: 1

铜币
0
发表于 2022-7-6 22:57:08 | 显示全部楼层
It works great! Thanks a lot!
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-4 13:42 , Processed in 0.378804 second(s), 70 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表