BIGAL Posted August 9, 2022 Posted August 9, 2022 Yes "Origin" is there and the code by ronjonp may have opened the door to insert a dynamic block and allow user to preset the values required in a dcl rather than clicking on block afterwards this is handy when you want to insert say the block again with maybe only 1 value to be changed. Width Origin Height Origin "Visibility1" Quote
TemporaryCAD Posted August 24, 2022 Author Posted August 24, 2022 Does anyone have a method to work around this? I thought I would be able to sidestep some difficulties, but this is a continued thorn in my side. What is happening is I am attempting to insert multiple dynamic blocks and have them interface with one another - something that should be simple. However, the blocks are drifting off of their origin, picking up seemingly nonsensical values for the origin location. For a written out example: if a square is defined such that it's bottom left corner is at (0,0), the defined insertion point of the dynamicblock. However, when inserted, this point is no longer located at the bottom left corner, and it could potentially be anywhere. As I'm sure you could imagine, this becomes a huge issue and what seems to be a massive flaw in dynamicblocks. I'd greatly appreciate any help - my next plan is to try to move the inserted object the difference between the proper insertion point and where it ended up. This is hacky and imperfect. Quote
BIGAL Posted August 25, 2022 Posted August 25, 2022 That sounds weird never heard that block does not match insertion point, sounds more like something in your dwg setup are you using a UCS or Snap ? Are you using plain "Insert" or "-insert" in a lisp or a entmake or ?? Need a dwg to look at. Quote
TemporaryCAD Posted August 25, 2022 Author Posted August 25, 2022 12 hours ago, BIGAL said: That sounds weird never heard that block does not match insertion point, sounds more like something in your dwg setup are you using a UCS or Snap ? Are you using plain "Insert" or "-insert" in a lisp or a entmake or ?? Need a dwg to look at. It's rather annoying to replicate since I cannot share the blocks I am directly working with. I made a sample block and it does not consistently replicate the issue. I've attached it, as well as the lisp, to this post. The lisp was written quickly so it's quite ugly, and it includes Lee Mac's setdynprops function. I'm wondering if the issue is the dynamic block definition is redefined every time I insert a block into the model. I.e. you tell it to add an incline, and the next block inherits that angle and adds on the angle it's supposed to have. dynamic fold.dwg dynfoldtest.lsp Quote
BIGAL Posted August 26, 2022 Posted August 26, 2022 I would write this as below no idea if will fix problem (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (command "-INSERT" "dynamic fold" "_s" 1 insrtpt 0.0) ..... (setvar ''osmode oldsnap) (princ) ) ; end defun Quote
Emmanuel Delay Posted January 13, 2023 Posted January 13, 2023 In case someone is interested... I was making a Match all dynamic props function; I found this "origin" problem, Google brought me here... Here's what I did ;;(setq source (car (entsel "\nSelect source block: "))) ;;(setq dest (car (entsel "\nSelect destinaion block: "))) (defun match_props (source dest / props ) (setq props (LM:getdynprops (vlax-ename->vla-object source))) (setq props (filter_props props)) (LM:setdynprops (vlax-ename->vla-object dest) props) ) ;; the "ORIGIN" key is a READONLY prop, so it must beremoved (defun filter_props (props / newprops prop) (setq newprops (list)) (foreach prop props (if (= "Origin" (car prop)) T (setq newprops (append newprops (list prop))) ) ) newprops ) 2 Quote
Lee Mac Posted January 13, 2023 Posted January 13, 2023 FWIW, here's a similar program I've posted previously - https://www.theswamp.org/index.php?topic=44444.msg496892#msg496892 3 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.