Here's one way to do it. (http://lee-mac.com/grtext.html)Thank you Lee. The example Grrr1337 posted is what I wanted to achieve. But I guess the logic is the same as your examples?
Yeah it is possible - through grread or reactors -Thanks Grrr1337. This is exactly what I wanted :-D. Not familiar with grread or reactor though. I might need to search for more examples to help me understand how it works.
Yes it's possible... But I am not willing to code it...Thank you all the same ribarm :-D
Yeah it is possible - through grread or reactors -Thanks Grrr1337. This is exactly what I wanted :-D. Not familiar with grread or reactor though. I might need to search for more examples to help me understand how it works.
Yeah it is possible - through grread or reactors -Thanks Grrr1337. This is exactly what I wanted :-D. Not familiar with grread or reactor though. I might need to search for more examples to help me understand how it works.
Looks like I've posted some demo here (https://www.theswamp.org/index.php?topic=53702.0) -- Big thanks to VoVka for sharing his (vk_Point2Pixel) and (vk_Pixel2Point) subs!
Heres another demo which uses mtext entity instead of Lee's (LM:GrText) -Code - Auto/Visual Lisp: [Select]
); defun ; (ReshrinkMtext (car (entsel)) 6) (setq ReshrinkMtext (repeat n (and e ); and ); repeat ); lambda ); setq ReshrinkMtext ; RetVal = object.AddMText(InsertionPoint, Width, Text) (setq o ) ) ; (vla-put-attachmentpoint o acTopLeft) ; (vla-put-BackgroundFill o :vlax-true) (ReshrinkMtext (vlax-vla-object->ename o) 6) ; Initialise color: '((62 . 102)) ) ; (setq pxl (WcsPt<->ScreenPt (getpoint "\nSpecify info position: ") t)) ; Initialise pxl: (setq pxl ( ; (setq tmp2 (mapcar '* '(0.008 0.008) (list (caar tmp) (cadadr tmp)))) ; (WcsPt<->ScreenPt (mapcar '+ tmp2 (apply '(lambda (a b) (list (car a) (cadr b))) tmp)) t) ; (mapcar '* '(1.01 0.99) (WcsPt<->ScreenPt (list (caar tmp) (cadadr tmp)) t)) ); lambda ) ); setq pxl ; (setq pxl '(930 1380)) (cond (cond ( (= v "T") ( (ReshrinkMtext (vlax-vla-object->ename o) 6) ) ) ) ) ) ( (= v "Q") (setq pxl ( ); lambda ) ); setq pxl ) ( (= v "E") (setq pxl ( ); lambda ) ); setq pxl ) ( (= v "P") ( ) ) ) ); lambda ) ) ); cond ); (= 2 k) ( (= 5 k) ; Cursor is moved ); (= 5 k) ; Cursor is moved ); cond ); while ); defun ;; Viewport Extents - Lee Mac ;; Returns two WCS points describing the lower-left and ;; upper-right corners of the active viewport. ) ) ; Translation between WCS point and Pixel - vice versa ; p - point [pixel or WCS] ; b - boolean [T/nil] | T = WcsPt->ScreenPt, nil = ScreenPt->WcsPt ; Vovka ; https://www.theswamp.org/index.php?topic=53702.0 (if b ); if ); defun WcsPt<->ScreenPt
Both techniques (LM:GrText) or creating MTEXT entity have their drawbacks as it goes for user experience (self-tested).
Here's a sample of my 'Q' routine that uses grread and mtext:
That's why there's paperspace.....I don't think so. Layout is just for printing. It doesn't allow you to keep the text facing the screen in a 3D model, and you cannot edit items in layout. What I want to do is edit objects in other plane other than XY in a 3D model and view the objects information etc while I zoom in/out, rotate or the like at the same time.
The attached gif explains what snownut2 is referring to. Put the text in paperspace and work on your model through an unlocked viewport.I do understand paperspace will make the sizes fixed. But like I have explained, this is not what I wanted to do. Take
The attached gif explains what snownut2 is referring to. Put the text in paperspace and work on your model through an unlocked viewport.I do understand paperspace will make the sizes fixed. But like I have explained, this is not what I wanted to do. Take
Grrr1337's gif as an example, I want the line object information to be displayed at the middle point of each line. Whenever I move/rotate the view port, the object information text will follow the line objects instead of having fixed locations. it is basically like normal texts, but they are always facing the screen with a fixed sizes.
The attached gif explains what snownut2 is referring to. Put the text in paperspace and work on your model through an unlocked viewport.I do understand paperspace will make the sizes fixed. But like I have explained, this is not what I wanted to do. Take
Grrr1337's gif as an example, I want the line object information to be displayed at the middle point of each line. Whenever I move/rotate the view port, the object information text will follow the line objects instead of having fixed locations. it is basically like normal texts, but they are always facing the screen with a fixed sizes.
You can try to turn on Quick Properties Palette with CTRL+SHIFT+P and select entity (PICKFIRST=1)... Basic info ab entity will pop up and you can continue working in 2D/3D... The point is that this feature can't operate separately for each entity selected... If that would be the situation you are looking for, it would be real mess with all those pop ups scattered around interface... Then you won't be able to work normally... My suggestion is that you always have main property palette on - docked left/right and only when needed to see info, you select entity/entities and move mouse left/right to see info palette... This is always facing to the view no matter you are orbiting in 3D or zooming/panning...
Further more you don't need any code/reactor active - it is standard way of working in CAD applications...
Not sure you've though that through, once you get just a few lines drawn the entire screen will be unreadable, just my 2cents......
Something like this?
You are probably right. So now I am not gonna make the size to be fixed. So the only difference between the text I want with the normal texts is to make them always facing the screen in a 3D model. Is this possible? I have seen other software do it this way. It makes it easier and nicer to view the text in 3D models.
What do you want to show if it is not properties?It can be part of the properties like layer, or it can be any other text that I want it to be, for example, I might assign additional properties to the lines.
QuoteSomething like this?
You are probably right. So now I am not gonna make the size to be fixed. So the only difference between the text I want with the normal texts is to make them always facing the screen in a 3D model. Is this possible? I have seen other software do it this way. It makes it easier and nicer to view the text in 3D models.
https://knowledge.autodesk.com/sites/default/files/my_first_autocad_plugin_promo_video_924x694_0.mp4 (https://knowledge.autodesk.com/sites/default/files/my_first_autocad_plugin_promo_video_924x694_0.mp4)
[..]
Pretty much! For example, I want the text in you video to be always at the centre of the circle when I rotate.
[..]
Pretty much! For example, I want the text in you video to be always at the centre of the circle when I rotate.
You want someone else to write such a function? If you can't develop such a function with the given examples, you might invest some time in the tooltips you can customize in AutoCAD. I think that is the easiest way to show object information without programming. And it will not polute your view on the drawing :-)
https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/AutoCAD-LT/files/GUID-BCC6FDB2-F4EA-4BE1-AC49-48EFE687DD2B-htm.html (https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/AutoCAD-LT/files/GUID-BCC6FDB2-F4EA-4BE1-AC49-48EFE687DD2B-htm.html)
QuoteSomething like this?
You are probably right. So now I am not gonna make the size to be fixed. So the only difference between the text I want with the normal texts is to make them always facing the screen in a 3D model. Is this possible? I have seen other software do it this way. It makes it easier and nicer to view the text in 3D models.
Pretty much! For example, I want the text in you video to be always at the centre of the circle when I rotate.
(mapcar ''((a b) (vlax-put obj a b))
'(Height Normal)
(list (* 5.0 (/ vs (cadr sc))) (getvar 'viewdir))
)
where vs=viewsize, sc=screensize are sysvarLooking back again, I don't think it will be unreadable even if I make the size fixed. I have tried using other 3D software and they are doing exactly what I wanted.
AFAIK (ac2007) grdraw or grvecs does not support multiple viewports ,Thank you. I think the previous video you sent has achieved pretty much what I wanted, is there any lisp version for that one? I don't mind have a single viewport only as long as it can maintain the text 210 dxf property.
i.e dynamic transient effect only works in single active space
.NET tutorial is interesting unfortunately i can't try it, minimum requirement v2012-2020
https://knowledge.autodesk.com/support/autocad/learn-explore/caas/simplecontent/content/my-first-autocad-plug-overview.html
can try reactor but its not dynamic,
perhaps alternative way is to write a function whichNot very familiar with reactor yet but will definitely try.
iterates thru ssget your filtered 'TEXT' collection, then modify 'Height' & 'Normal' properties which related to 'viewdir'
Code: [Select]
(mapcar ''((a b) (vlax-put obj a b))
'(Height Normal)
(list (* 5.0 (/ vs (cadr sc))) (getvar 'viewdir))
)
where vs=viewsize, sc=screensize are sysvar
if your textsize is relatively 5% to viewsize, when you zoom far out, the texts still overlap & unreadableI think this is fine, if you zoom far out the texts will be unreadable with fixed sizes as well. And I have seen many 3D software do it this way. That being said, I don't mind have texts height fixed. The critical part is to maintain the texts normal properties so the texts can be easier to view in 3D model.