Jump to content

Set Dynamic Block Property - Origin


TemporaryCAD

Recommended Posts

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"

Link to comment
Share on other sites

  • 2 weeks later...

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.  

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

  • 4 months later...

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
)

 

  • Like 2
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...