奇怪的行为
有人能告诉我为什么这有时会引起人们的关注吗。125条长线,有时它会把它们画在。25长。旋转半径:
参见图片。第一个结果围绕WCS轴,第二个结果围绕重心 非常感谢这些富有洞察力的回复。Fixo,我肯定会用\\P来整合多行文字的方法。我知道一定有更好的方法,但网络上的许多搜索证明LISP和text并不是线程中常见的。
Stephan MBR-我正在使用另一个名为stl的lisp例程。lsp。这是伟大的钢细节,虽然我在这个项目的主要原因是与铝工作。我最终会在代码中放置一个提示,询问用户形状是钢还是铝,并根据输入计算重量/英尺和其他。Stl。lsp相当准确地绘制了配置文件,至少是我能够检查到的。我必须将形状转化为一个区域,但然后我运行MASSPROP并获得许多信息,我正在对照AISC手册进行交叉检查。我确信像SolidWorks这样的软件可以自动并且更准确地完成这项工作,但我没有SolidWorks的许可证,而且在可预见的将来也不会。 Sorry Bill, I missed a second "_non", the code should be:
(command "_.circle" "_non" ip "0.125")(command "_.line" "_non" ip "_non" "@0.25 As sloppy as this may be I almost have it where it will be. The text is not an easy thing to do. I have about 50 LISP programs in my collection and it wasn't until I started looking for some text examples that I realized I don't have any. I guess it makes sense that LISP is not really the correct tool for entering text. But this routine is an exception to that rule. Here is what I have so far. You will need a shape like an extrusion of some kind to run this on. I don't think I have the weight thing right just yet and I'm still seeing about a 2% discrpency between the Ix figures I get and the published ones for steel shapes in the AISC manual.
(defun c:test ( / e o f d l ) (if (and (setq e (car (entsel))) (setq o (vlax-ename->vla-object e)) (eq "AcDbRegion" (vla-get-objectname o)) ;(setq f (vl-filename-mktemp nil (getvar 'dwgprefix) ".txt")) ;(setq d (open f "w")) ) (progn (princ (strcat "Area: " (rtos (vlax-get o 'area)) "Wt/Ft = " (rtos (* (vlax-get o 'area) 1.18) 2 2) "\nPerimeter: " (rtos (vlax-get o 'perimeter)) "\nCentroid: " (progn (setq l (mapcar 'rtos (vlax-get o 'centroid))) (strcat (car l) "," (cadr l)) (setq ip (strcat (car l) "," (cadr l))) ) "\nRadii of Gyration: " (progn (setq l (mapcar 'rtos (vlax-get o 'radiiofgyration))) (strcat (car l) "," (cadr l)) ) "\nPrincipal Moments: " (progn (setq l (mapcar 'rtos (vlax-get o 'principalmoments))) (strcat (car l) "," (cadr l)) ) ) ; d ) ;(close d)(setq l1 (strcat "Area:" (rtos (vlax-get o 'area) 2 4) " Sq In"))(setq l2 (strcat "Wt/Ft:" (rtos (* (vlax-get o 'area) 1.18) 2 2) " lbs"))(setq l3 (strcat "Perimeter: " (rtos (vlax-get o 'perimeter) 2 2) " In"))(setq l4 (strcat "Ix:" (cadr l)))(setq l5 (strcat "Iy:" (car l)))(princ l); Draw the Center of Gravity Point(command "_.circle" "_non" ip "0.125" "")(command "_.line" "_non" ip "@0.25 Just on the quick glance
any command do not require double quotes at the end of expression, e.g:
(command "_.circle" "_non" ip "0.125" ); Hi Bill
About 2% differences, is the shape double symmetric? If it's not (and you can see that next to Principal Moments, if directions are different than ) then you need another method to get the correct values. I know two methods:
1) First, run _massprop and collect the centroid coordinates; then set UCS to centroid. Run _massprop once again and compare Moments Of Inertia (and not Principal moments) with AISC manual.
2) Second method required to run _massprop once and no UCS settings:
- read area A
- read centroid from _massprop-(xg, yg)
- read Moments of Inertia - (Ix, Iy)
The moments around centroid an parallelto x and y axis:
Ixg = Ix - A*yg^2Iyg = Iy - A*xg^2Radii of gyration:
rxg = sqrt (Ixg / A)ryg = sqrt (Iyg / A)See the picture. First results are around WCS axis and second around Center of gravity. Many thanks for these insightful replies. Fixo, I will certainly incoporate that method for mtext using \\ P. I knew there had to be a better way but many searches on the net proved that LISP and text are not that common of a thread.
Stephan MBR - I am using another lisp routine called stl.lsp. It's great for steel detailing, although the main reason I'm working on this project is for working with aluminum. I will eventually place a prompt in the code which asks the user whether the shape is steel or aluminum and it will calculate weight/foot and others based on that input. Stl.lsp draws up the profiles quite accurately, at least what I've been able to check. I have to turn the shape into a REGION but then I run MASSPROP and get lots of information which I'm cross-checking against the AISC manual. I'm sure something like SolidWorks does this automatically and with greater accuracy, but I don't have a license for SolidWorks and will not in the forseeable future.
页:
[1]