乐筑天下

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

[编程交流] what's wrong in my code (

[复制链接]

5

主题

1334

帖子

1410

银币

限制会员

铜币
-20
发表于 2022-7-6 07:03:13 | 显示全部楼层
OP changed formulas at 05:14 pm... But I think that now can finish the code right...
 
Cheers, Black Box...
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:05:04 | 显示全部楼层
 
Cheers, Marko
回复

使用道具 举报

107

主题

615

帖子

575

银币

中流砥柱

Rank: 25

铜币
521
发表于 2022-7-6 07:08:42 | 显示全部楼层
is not working now
回复

使用道具 举报

107

主题

615

帖子

575

银币

中流砥柱

Rank: 25

铜币
521
发表于 2022-7-6 07:13:28 | 显示全部楼层
Command: (LOAD "C:/Users/Prodromos/Desktop/ktimtel.lsp") C:KTIM
Command: ktim
** Scale must be "1:1000" or "1:5000"
Command:
 
!!!!!!!!!!!!!!!!!!!!!!!!!!
回复

使用道具 举报

107

主题

615

帖子

575

银币

中流砥柱

Rank: 25

铜币
521
发表于 2022-7-6 07:15:06 | 显示全部楼层
but i still need help because i confused
回复

使用道具 举报

107

主题

615

帖子

575

银币

中流砥柱

Rank: 25

铜币
521
发表于 2022-7-6 07:20:23 | 显示全部楼层
a) if the scale 1: 1000 we have this T = [((sqrtA) + 1)^ 2) - A] * [ L/( 4*(sqrtA)]
b) if the scale 1: 5000 we have this T = [((sqrtA) + 4)^ 2) - A] * [ L/( 4*(sqrtA)]
 
something is wrong here because
for A=266.50sqm and L=66.18 m calculate a) T=8.526 and the correct is T = 34.10
                                                         b) T=37.144 and the correct is T = 148.58
here is the code
--------------------------------
  1. (defun c:ktim (/ a l i s) (if (setq s            (ssget              '((0 . "CIRCLE,ELLIPSE,*POLYLINE,SPLINE")                (-4 . "")               )            )     )   (progn     (setq a 0.0)     (repeat (setq i (sslength s))       (setq a (+ a (vlax-curve-getarea (ssname s (setq i (1- i))))))     );;;      (progn     (setq l 0.0)     (repeat (setq i (sslength s))       (setq e (ssname s (setq i (1- i)))             l (+ l                  (vlax-curve-getdistatparam e (vlax-curve-getendparam e))               )       )     )(textscr)     (princ "\nTotal Length: ")     (princ (rtos l 2 2));;;      )     (princ "\nTotal Area: ")     (princ (rtos a 2 2));;;    )     (princ "\n Tolerance 1:1000: ")     (princ       (rtos (/ (* (- (* (+ (sqrt a) 1) (+ (sqrt a) 1)) a) l)                (* (sqrt a) 4)                2                2             )       )     )(princ "\n Tolerance 1:5000: ")     (princ       (rtos (/ (* (- (* (+ (sqrt a) 4) (+ (sqrt a) 4)) a) l)                (* (sqrt a) 4)                2                2             )       )     )     (princ "\n 10 % Area : ")     (princ (rtos (* a 0.1) 2 2))   ) ) (princ))(vl-load-com)(princ)
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:22:43 | 显示全部楼层
 
How are you determining your scale (1:1000 vs. 1:5000)?
 
As I mentioned at the bottom of this post, I could only speculate that you were using Annotative Scale... Perhaps you're using DimScale?
 
In any event, without knowing which scale to check for the two specific values you requested, there's no way to ensure that the calculation is accurate.
 
more information is needed, so that we're not confused.
回复

使用道具 举报

107

主题

615

帖子

575

银币

中流砥柱

Rank: 25

铜币
521
发表于 2022-7-6 07:26:07 | 显示全部楼层
Select objects:
 
Total Length: 66.18
Total Area: 266.50
Tolerance 1:1000: 8.526
Tolerance 1:5000: 37.144
10 % Area : 26.65
 
Command:
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:29:12 | 显示全部楼层
Please fix your post(s) to use
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 07:30:48 | 显示全部楼层
Ohhhhh! You want to see BOTH tolerances.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-10 15:42 , Processed in 0.440330 second(s), 70 queries .

© 2020-2025 乐筑天下

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